From fa1f3ad73a8e51a6eba1793df615d68ab55f6d5f Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Wed, 30 Mar 2022 17:18:34 +0800 Subject: [PATCH] Windows QPA: Enhance theme change notify DWM colorization color change should also be considered as a theme change event. Change-Id: I55562b9d43988aafc8a60a6264fe16dccbefff92 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qtwindowsglobal.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h index 3853a0afa4..2f36b31e73 100644 --- a/src/plugins/platforms/windows/qtwindowsglobal.h +++ b/src/plugins/platforms/windows/qtwindowsglobal.h @@ -44,8 +44,16 @@ #include #include -#ifndef WM_DWMCOMPOSITIONCHANGED // MinGW. -# define WM_DWMCOMPOSITIONCHANGED 0x31E +#ifndef WM_DWMCOMPOSITIONCHANGED +# define WM_DWMCOMPOSITIONCHANGED 0x31E +#endif + +#ifndef WM_DWMCOLORIZATIONCOLORCHANGED +# define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320 +#endif + +#ifndef WM_SYSCOLORCHANGE +# define WM_SYSCOLORCHANGE 0x0015 #endif #ifndef WM_TOUCH @@ -288,9 +296,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI case WM_DISPLAYCHANGE: return QtWindows::DisplayChangedEvent; case WM_THEMECHANGED: -#ifdef WM_SYSCOLORCHANGE // Windows 7: Handle color change as theme change (QTBUG-34170). - case WM_SYSCOLORCHANGE: -#endif + case WM_SYSCOLORCHANGE: // Handle color change as theme change (QTBUG-34170). + case WM_DWMCOLORIZATIONCOLORCHANGED: return QtWindows::ThemeChanged; case WM_DWMCOMPOSITIONCHANGED: return QtWindows::CompositionSettingsChanged;