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>
This commit is contained in:
Friedemann Kleint 2016-02-25 10:01:21 +01:00 committed by Simon Hausmann
parent cf846d6a8a
commit d1dfcc776f

View File

@ -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";
}