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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-04-27 11:35:28 +08:00 committed by Alexandre Julliard
parent 00e1664b0b
commit 2de05267d7
2 changed files with 3 additions and 17 deletions

View File

@ -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);
}

View File

@ -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);
{