From a9eee150ad03e28829ffafd1b3fff57fffc816a7 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 7 Oct 2021 16:34:01 +0200 Subject: [PATCH] user32: Update exstyle when setting style in SetWindowLong. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/user32/tests/win.c | 14 ++++++-------- dlls/user32/win.c | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 93d1e8ec232..f9428fd3494 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -4548,8 +4548,7 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle else dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE; ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle); - todo_wine_if (!dwStyleIn) - ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle); + ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle); DestroyWindow(hwnd); if (hwndParent) DestroyWindow(hwndParent); @@ -4701,7 +4700,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou WORD class_atom; WCHAR caption[1]; } dlg_data; - DWORD style, ex_style, ex_style_out2; + DWORD style, ex_style; HWND hwnd, grand_parent = 0, parent = 0; struct dialog_param param; @@ -4763,13 +4762,12 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou ok(style == style_out, "expected style %#x, got %#x\n", style_out, style); /* WS_EX_WINDOWEDGE can't always be changed */ if (ex_style_in & WS_EX_DLGMODALFRAME) - ex_style_out2 = ex_style_in | WS_EX_WINDOWEDGE; + ex_style_out = ex_style_in | WS_EX_WINDOWEDGE; else if ((style & (WS_DLGFRAME | WS_THICKFRAME)) && !(ex_style_in & WS_EX_STATICEDGE)) - ex_style_out2 = ex_style_in | WS_EX_WINDOWEDGE; + ex_style_out = ex_style_in | WS_EX_WINDOWEDGE; else - ex_style_out2 = ex_style_in & ~WS_EX_WINDOWEDGE; - todo_wine_if (ex_style_out != ex_style_out2) - ok(ex_style == ex_style_out2, "expected ex_style %#x, got %#x\n", ex_style_out2, ex_style); + ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE; + ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); DestroyWindow(hwnd); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index a1464f01345..21214432b6d 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -2619,8 +2619,6 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B if (wndPtr->parent == GetDesktopWindow()) newval |= WS_CLIPSIBLINGS; /* WS_MINIMIZE can't be reset */ if (wndPtr->dwStyle & WS_MINIMIZE) newval |= WS_MINIMIZE; - /* FIXME: changing WS_DLGFRAME | WS_THICKFRAME is supposed to change - WS_EX_WINDOWEDGE too */ break; case GWL_EXSTYLE: style.styleOld = wndPtr->dwExStyle; @@ -2699,8 +2697,9 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B switch(offset) { case GWL_STYLE: - req->flags = SET_WIN_STYLE; + req->flags = SET_WIN_STYLE | SET_WIN_EXSTYLE; req->style = newval; + req->ex_style = fix_exstyle(newval, wndPtr->dwExStyle); break; case GWL_EXSTYLE: req->flags = SET_WIN_EXSTYLE; @@ -2734,6 +2733,7 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B { case GWL_STYLE: wndPtr->dwStyle = newval; + wndPtr->dwExStyle = fix_exstyle(wndPtr->dwStyle, wndPtr->dwExStyle); retval = reply->old_style; break; case GWL_EXSTYLE: -- 2.11.4.GIT