Commit 2de05267 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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=44511Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 00e1664b
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <stdio.h> #include <stdio.h>
#include <windows.h> #include <windows.h>
#include <commctrl.h> #include <commctrl.h>
#include <uxtheme.h>
#include "wine/test.h" #include "wine/test.h"
#include "v6util.h" #include "v6util.h"
...@@ -40,9 +39,8 @@ static BOOL (WINAPI * pStr_SetPtrW)(LPWSTR, LPCWSTR); ...@@ -40,9 +39,8 @@ static BOOL (WINAPI * pStr_SetPtrW)(LPWSTR, LPCWSTR);
static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR);
static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR);
static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM); static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM);
static BOOL (WINAPI *pIsThemeActive)(void);
static HMODULE hComctl32, hUxtheme; static HMODULE hComctl32;
/* For message tests */ /* For message tests */
enum seq_index enum seq_index
...@@ -108,9 +106,6 @@ static BOOL init_functions_v6(void) ...@@ -108,9 +106,6 @@ static BOOL init_functions_v6(void)
COMCTL32_GET_PROC(412, RemoveWindowSubclass) COMCTL32_GET_PROC(412, RemoveWindowSubclass)
COMCTL32_GET_PROC(413, DefSubclassProc) COMCTL32_GET_PROC(413, DefSubclassProc)
hUxtheme = LoadLibraryA("uxtheme.dll");
pIsThemeActive = (void *)GetProcAddress(hUxtheme, "IsThemeActive");
return TRUE; return TRUE;
} }
...@@ -630,7 +625,6 @@ static INT_PTR CALLBACK wm_syscolorchange_dlg_proc(HWND hwnd, UINT message, WPAR ...@@ -630,7 +625,6 @@ static INT_PTR CALLBACK wm_syscolorchange_dlg_proc(HWND hwnd, UINT message, WPAR
static void test_WM_SYSCOLORCHANGE(void) static void test_WM_SYSCOLORCHANGE(void)
{ {
HWND parent, dialog; HWND parent, dialog;
BOOL todo;
struct struct
{ {
DLGTEMPLATE tmplate; DLGTEMPLATE tmplate;
...@@ -652,8 +646,7 @@ static void test_WM_SYSCOLORCHANGE(void) ...@@ -652,8 +646,7 @@ static void test_WM_SYSCOLORCHANGE(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES); flush_sequences(sequences, NUM_MSG_SEQUENCES);
SendMessageW(dialog, WM_SYSCOLORCHANGE, 0, 0); SendMessageW(dialog, WM_SYSCOLORCHANGE, 0, 0);
todo = pIsThemeActive && pIsThemeActive(); ok_sequence(sequences, CHILD_SEQ_INDEX, wm_syscolorchange_seq, "test dialog WM_SYSCOLORCHANGE", FALSE);
ok_sequence(sequences, CHILD_SEQ_INDEX, wm_syscolorchange_seq, "test dialog WM_SYSCOLORCHANGE", todo);
EndDialog(dialog, 0); EndDialog(dialog, 0);
DestroyWindow(parent); DestroyWindow(parent);
...@@ -687,5 +680,4 @@ START_TEST(misc) ...@@ -687,5 +680,4 @@ START_TEST(misc)
unload_v6_module(ctx_cookie, hCtx); unload_v6_module(ctx_cookie, hCtx);
FreeLibrary(hComctl32); FreeLibrary(hComctl32);
FreeLibrary(hUxtheme);
} }
...@@ -64,12 +64,6 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, ...@@ -64,12 +64,6 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
InvalidateRect( hWnd, NULL, TRUE ); InvalidateRect( hWnd, NULL, TRUE );
return 0; 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: case WM_ERASEBKGND:
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment