Piotr Caban : user32: Update exstyle when setting style in SetWindowLong.
Alexandre Julliard
julliard at winehq.org
Thu Oct 7 16:21:21 CDT 2021
Module: wine
Branch: master
Commit: a9eee150ad03e28829ffafd1b3fff57fffc816a7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a9eee150ad03e28829ffafd1b3fff57fffc816a7
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu Oct 7 16:34:01 2021 +0200
user32: Update exstyle when setting style in SetWindowLong.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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:
More information about the wine-cvs
mailing list