Alexandre Julliard : winex11: Only map the window the first time that WS_VISIBLE is set through WM_SETREDRAW .
Alexandre Julliard
julliard at winehq.org
Fri Dec 10 11:56:57 CST 2010
Module: wine
Branch: master
Commit: 026d41c504175b8ee3a8681a585d2a424622c3d6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=026d41c504175b8ee3a8681a585d2a424622c3d6
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Dec 9 19:45:34 2010 +0100
winex11: Only map the window the first time that WS_VISIBLE is set through WM_SETREDRAW.
---
dlls/winex11.drv/window.c | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index dee77bd..2447a5f 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1819,17 +1819,16 @@ void CDECL X11DRV_SetWindowText( HWND hwnd, LPCWSTR text )
*/
void CDECL X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
{
- struct x11drv_win_data *data;
+ struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
DWORD changed;
if (hwnd == GetDesktopWindow()) return;
changed = style->styleNew ^ style->styleOld;
- if (offset == GWL_STYLE && (changed & WS_VISIBLE) && (style->styleNew & WS_VISIBLE))
+ /* 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)
{
- /* we don't unmap windows, that causes trouble with the window manager */
- if (!(data = X11DRV_get_win_data( hwnd )) &&
- !(data = X11DRV_create_win_data( hwnd ))) return;
+ if (!(data = X11DRV_create_win_data( hwnd ))) return;
if (data->whole_window && is_window_rect_mapped( &data->window_rect ))
{
@@ -1838,20 +1837,13 @@ void CDECL X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
if (!data->mapped) map_window( display, data, style->styleNew );
}
}
+ if (!data || !data->whole_window) return;
if (offset == GWL_STYLE && (changed & WS_DISABLED))
- {
- data = X11DRV_get_win_data( hwnd );
- if (data && data->whole_window)
- set_wm_hints( thread_display(), data );
- }
+ set_wm_hints( thread_display(), data );
- if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED))
- {
- /* changing WS_EX_LAYERED resets attributes */
- if ((data = X11DRV_get_win_data( hwnd )) && data->whole_window)
- sync_window_opacity( thread_display(), data->whole_window, 0, 0, 0 );
- }
+ if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED)) /* changing WS_EX_LAYERED resets attributes */
+ sync_window_opacity( thread_display(), data->whole_window, 0, 0, 0 );
}
More information about the wine-cvs
mailing list