Alexandre Julliard : user32: Always go through set_window_pos when the WS_VISIBLE style is changed.
Alexandre Julliard
julliard at winehq.org
Wed Aug 29 15:01:38 CDT 2012
Module: wine
Branch: master
Commit: d35fc4369fd9eb7e5fca78cc0d61e241de286ee0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d35fc4369fd9eb7e5fca78cc0d61e241de286ee0
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Aug 29 18:08:37 2012 +0200
user32: Always go through set_window_pos when the WS_VISIBLE style is changed.
---
dlls/user32/win.c | 19 ++++++++++++++++++-
dlls/winex11.drv/window.c | 16 ++--------------
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index cc8461a..66fc8cc 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -641,8 +641,16 @@ ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits )
WIN_ReleasePtr( win );
if (ok)
{
+ if ((style.styleOld ^ style.styleNew) & WS_VISIBLE)
+ {
+ RECT window_rect, client_rect;
+ UINT flags = style.styleNew & WS_VISIBLE ? SWP_SHOWWINDOW : 0; /* we don't hide it */
+
+ WIN_GetRectangles( hwnd, COORDS_PARENT, &window_rect, &client_rect );
+ set_window_pos( hwnd, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE |
+ SWP_NOZORDER | SWP_NOACTIVATE | flags, &window_rect, &client_rect, NULL );
+ }
USER_Driver->pSetWindowStyle( hwnd, GWL_STYLE, &style );
- if ((style.styleOld ^ style.styleNew) & WS_VISIBLE) invalidate_dce( hwnd, NULL );
}
return style.styleOld;
}
@@ -2334,6 +2342,15 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
{
style.styleOld = retval;
style.styleNew = newval;
+ if (offset == GWL_STYLE && ((style.styleOld ^ style.styleNew) & WS_VISIBLE))
+ {
+ RECT window_rect, client_rect;
+ UINT flags = style.styleNew & WS_VISIBLE ? SWP_SHOWWINDOW : 0; /* we don't hide it */
+
+ WIN_GetRectangles( hwnd, COORDS_PARENT, &window_rect, &client_rect );
+ set_window_pos( hwnd, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE |
+ SWP_NOZORDER | SWP_NOACTIVATE | flags, &window_rect, &client_rect, NULL );
+ }
USER_Driver->pSetWindowStyle( hwnd, offset, &style );
SendMessageW( hwnd, WM_STYLECHANGED, offset, (LPARAM)&style );
}
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 9070669..5840e85 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1807,22 +1807,10 @@ void CDECL X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
DWORD changed;
if (hwnd == GetDesktopWindow()) return;
- changed = style->styleNew ^ style->styleOld;
-
- /* if WS_VISIBLE was set through WM_SETREDRAW, map the window if it's the first time */
- if (offset == GWL_STYLE && (changed & WS_VISIBLE) && (style->styleNew & WS_VISIBLE) && !data)
- {
- if (!(data = X11DRV_create_win_data( hwnd ))) return;
-
- if (data->whole_window && is_window_rect_mapped( &data->window_rect ))
- {
- Display *display = thread_display();
- set_wm_hints( display, data );
- if (!data->mapped) map_window( display, data, style->styleNew );
- }
- }
if (!data || !data->whole_window) return;
+ changed = style->styleNew ^ style->styleOld;
+
if (offset == GWL_STYLE && (changed & WS_DISABLED))
set_wm_hints( thread_display(), data );
More information about the wine-cvs
mailing list