summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qtwindowsglobal.h
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/qtwindowsglobal.h
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/qtwindowsglobal.h')
-rw-r--r--src/plugins/platforms/windows/qtwindowsglobal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index 27632de688..a5c05bf1a3 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -56,6 +56,10 @@
# define WM_GESTURE 0x0119
#endif
+#ifndef WM_DPICHANGED
+# define WM_DPICHANGED 0x02E0
+#endif
+
QT_BEGIN_NAMESPACE
namespace QtWindows
@@ -96,6 +100,7 @@ enum WindowsEventType // Simplify event types
FocusInEvent = WindowEventFlag + 17,
FocusOutEvent = WindowEventFlag + 18,
WhatsThisEvent = WindowEventFlag + 19,
+ DpiChangedEvent = WindowEventFlag + 21,
MouseEvent = MouseEventFlag + 1,
MouseWheelEvent = MouseEventFlag + 2,
CursorEvent = MouseEventFlag + 3,
@@ -266,6 +271,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
#endif
case WM_GESTURE:
return QtWindows::GestureEvent;
+ case WM_DPICHANGED:
+ return QtWindows::DpiChangedEvent;
default:
break;
}