Zhiyi Zhang : comctl32/theme_dialog: Pass the WM_SYSCOLORCHANGE message to the original dialog procedure.

Alexandre Julliard julliard at winehq.org
Wed Apr 28 16:18:47 CDT 2021


Module: wine
Branch: master
Commit: 2de05267d76bf2a388ed7519b502c73f9e89537c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2de05267d76bf2a388ed7519b502c73f9e89537c

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Tue Apr 27 11:35:28 2021 +0800

comctl32/theme_dialog: Pass the WM_SYSCOLORCHANGE message to the original dialog procedure.

Even though themed dialog itself doesn't need to repaint after WM_SYSCOLORCHANGE is received,
WM_SYSCOLORCHANGE should be passed to the original dialog procedure DefDlgProcW(), which can then
forward WM_SYSCOLORCHANGE to its common controls and call COMCTL32_RefreshSysColors().

Fix wrong property sheet tab background color after winecfg disables theming.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44511
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/misc.c   | 12 ++----------
 dlls/comctl32/theme_dialog.c |  8 +-------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c
index ccbda7aebeb..eba7858d7b9 100644
--- a/dlls/comctl32/tests/misc.c
+++ b/dlls/comctl32/tests/misc.c
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <windows.h>
 #include <commctrl.h>
-#include <uxtheme.h>
 
 #include "wine/test.h"
 #include "v6util.h"
@@ -40,9 +39,8 @@ static BOOL (WINAPI * pStr_SetPtrW)(LPWSTR, LPCWSTR);
 static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR);
 static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR);
 static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM);
-static BOOL (WINAPI *pIsThemeActive)(void);
 
-static HMODULE hComctl32, hUxtheme;
+static HMODULE hComctl32;
 
 /* For message tests */
 enum seq_index
@@ -108,9 +106,6 @@ static BOOL init_functions_v6(void)
     COMCTL32_GET_PROC(412, RemoveWindowSubclass)
     COMCTL32_GET_PROC(413, DefSubclassProc)
 
-    hUxtheme = LoadLibraryA("uxtheme.dll");
-    pIsThemeActive = (void *)GetProcAddress(hUxtheme, "IsThemeActive");
-
     return TRUE;
 }
 
@@ -630,7 +625,6 @@ static INT_PTR CALLBACK wm_syscolorchange_dlg_proc(HWND hwnd, UINT message, WPAR
 static void test_WM_SYSCOLORCHANGE(void)
 {
     HWND parent, dialog;
-    BOOL todo;
     struct
     {
         DLGTEMPLATE tmplate;
@@ -652,8 +646,7 @@ static void test_WM_SYSCOLORCHANGE(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     SendMessageW(dialog, WM_SYSCOLORCHANGE, 0, 0);
-    todo = pIsThemeActive && pIsThemeActive();
-    ok_sequence(sequences, CHILD_SEQ_INDEX, wm_syscolorchange_seq, "test dialog WM_SYSCOLORCHANGE", todo);
+    ok_sequence(sequences, CHILD_SEQ_INDEX, wm_syscolorchange_seq, "test dialog WM_SYSCOLORCHANGE", FALSE);
 
     EndDialog(dialog, 0);
     DestroyWindow(parent);
@@ -687,5 +680,4 @@ START_TEST(misc)
 
     unload_v6_module(ctx_cookie, hCtx);
     FreeLibrary(hComctl32);
-    FreeLibrary(hUxtheme);
 }
diff --git a/dlls/comctl32/theme_dialog.c b/dlls/comctl32/theme_dialog.c
index 29007ba5c60..0f7835ae32f 100644
--- a/dlls/comctl32/theme_dialog.c
+++ b/dlls/comctl32/theme_dialog.c
@@ -63,13 +63,7 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
 	OpenThemeData( hWnd, themeClass );
 	InvalidateRect( hWnd, NULL, TRUE );
 	return 0;
-	
-    case WM_SYSCOLORCHANGE:
-	if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
-        /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
-   	 * which will do the repaint. */
-        break;
-        
+
     case WM_ERASEBKGND:
 	if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
         {




More information about the wine-cvs mailing list