diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-25 10:01:21 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-02-26 08:24:27 +0000 |
commit | d1dfcc776fd3bf738d0c6e7125f5bb2c9aecc57e (patch) | |
tree | 36e58067cf0dbd06bb562cd868564896d389379f /src | |
parent | cf846d6a8a0df0f0935f7f1306ab8439309cf6e5 (diff) |
Windows QPA: Apply scaling when fixing maximized/frameless geometry.
Task-number: QTBUG-8361
Task-number: QTBUG-51327
Change-Id: I590702df8f6313701fe69d0873657c6af53fee16
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index e2f5885047..c0892feabe 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2089,14 +2089,15 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const // Documentation of MINMAXINFO states that it will only work for the primary screen if (screen && screen == QGuiApplication::primaryScreen()) { - mmi->ptMaxSize.y = screen->availableGeometry().height(); + const QRect availableGeometry = QHighDpi::toNativePixels(screen->availableGeometry(), screen); + mmi->ptMaxSize.y = availableGeometry.height(); // Width, because you can have the taskbar on the sides too. - mmi->ptMaxSize.x = screen->availableGeometry().width(); + mmi->ptMaxSize.x = availableGeometry.width(); // If you have the taskbar on top, or on the left you don't want it at (0,0): - mmi->ptMaxPosition.x = screen->availableGeometry().x(); - mmi->ptMaxPosition.y = screen->availableGeometry().y(); + mmi->ptMaxPosition.x = availableGeometry.x(); + mmi->ptMaxPosition.y = availableGeometry.y(); } else if (!screen){ qWarning() << "window()->screen() returned a null screen"; } |