summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-02-13 08:48:25 +0100
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2017-02-16 15:31:38 +0000
commitcd2b5f1ada07fc7a5ec31e3b48a7fdf76bf62020 (patch)
tree882e22fc30624de0f5f4883d658ebad7bc170c9f /src/plugins/platforms/windows/qwindowswindow.cpp
parent2b34aefcf02f09253473b096eb4faffd3e62b5f4 (diff)
Resize the window when the screen's dpi changes
That's what the MSDN documentation say one should do in the handler for WM_DPICHANGED [ChangeLog][QtGui][Windows] Windows are now automatically resized when they are moved on a screen to adapt to the new pixel ratio. Task-number: QTBUG-55510 Task-number: QTBUG-48242 Change-Id: I7688f12165f76585d75686e2e94b0fc562627be2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 42eb6d4ca7..40229d00af 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -2114,8 +2114,12 @@ void QWindowsWindow::setFrameStrutEventsEnabled(bool enabled)
void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
{
- const QWindowsGeometryHint hint(window(), m_data.customMargins);
- hint.applyToMinMaxInfo(m_data.hwnd, mmi);
+ // We don't apply the min/max size hint as we change the dpi, because we did not adjust the
+ // QScreen of the window yet so we don't have the min/max with the right ratio
+ if (!testFlag(QWindowsWindow::WithinDpiChanged)) {
+ const QWindowsGeometryHint hint(window(), m_data.customMargins);
+ hint.applyToMinMaxInfo(m_data.hwnd, mmi);
+ }
if ((testFlag(WithinMaximize) || (window()->windowState() == Qt::WindowMinimized))
&& (m_data.flags & Qt::FramelessWindowHint)) {