fixed inital scaling being wrong on windows

This commit is contained in:
fourtf 2018-06-24 15:41:12 +02:00
parent 24471fc2d0
commit 683017008a
2 changed files with 9 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include "debug/log.hpp" #include "debug/log.hpp"
#include "singletons/settingsmanager.hpp" #include "singletons/settingsmanager.hpp"
#include "singletons/thememanager.hpp" #include "singletons/thememanager.hpp"
#include "widgets/basewindow.hpp"
#include <QChildEvent> #include <QChildEvent>
#include <QDebug> #include <QDebug>

View file

@ -427,6 +427,14 @@ bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message, long *r
return true; return true;
} }
case WM_SHOWWINDOW: {
float scale = GetDpiForWindow(msg->hwnd) / 96.f;
this->nativeScale_ = scale;
this->updateScale();
return true;
}
case WM_NCCALCSIZE: { case WM_NCCALCSIZE: {
if (this->hasCustomWindowFrame()) { if (this->hasCustomWindowFrame()) {
int cx = GetSystemMetrics(SM_CXSIZEFRAME); int cx = GetSystemMetrics(SM_CXSIZEFRAME);