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 <oliver.wolff@qt.io>
bb10
Yuhang Zhao 2022-03-30 17:18:34 +08:00
parent fedba8eaab
commit fa1f3ad73a
1 changed files with 12 additions and 5 deletions

View File

@ -44,8 +44,16 @@
#include <QtCore/qt_windows.h>
#include <QtCore/qnamespace.h>
#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;