Alexandre Julliard : winex11: Check for managed mode in create_whole_window again now that it is called lazily .

Alexandre Julliard julliard at winehq.org
Fri Jan 25 07:06:05 CST 2008


Module: wine
Branch: master
Commit: e6dfbcb07f912dba9d7eb456114fe9cd8a8270c8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e6dfbcb07f912dba9d7eb456114fe9cd8a8270c8

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jan 25 12:07:11 2008 +0100

winex11: Check for managed mode in create_whole_window again now that it is called lazily.

---

 dlls/winex11.drv/window.c |    7 +++++++
 dlls/winex11.drv/winpos.c |   20 ++++++++------------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 5aa01d9..5ead133 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1102,6 +1102,13 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
     if (!(cx = data->window_rect.right - data->window_rect.left)) cx = 1;
     if (!(cy = data->window_rect.bottom - data->window_rect.top)) cy = 1;
 
+    if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->window_rect ))
+    {
+        TRACE( "making win %p/%lx managed\n", data->hwnd, data->whole_window );
+        data->managed = TRUE;
+        SetPropA( data->hwnd, managed_prop, (HANDLE)1 );
+    }
+
     mask = get_window_attributes( display, data, &attr );
 
     wine_tsx11_lock();
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index b1a89fb..1a3cde5 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -139,21 +139,19 @@ void X11DRV_SetWindowStyle( HWND hwnd, DWORD old_style )
 
     if (changed & WS_VISIBLE)
     {
-        if (!(data = X11DRV_get_win_data( hwnd )) &&
-            !(data = X11DRV_create_win_data( hwnd ))) return;
+        data = X11DRV_get_win_data( hwnd );
+        if (data) invalidate_dce( hwnd, &data->window_rect );
+
+        /* we don't unmap windows, that causes trouble with the window manager */
+        if (!(new_style & WS_VISIBLE)) return;
+
+        if (!data && !(data = X11DRV_create_win_data( hwnd ))) return;
 
-        if (data->whole_window && (new_style & WS_VISIBLE) &&
-            X11DRV_is_window_rect_mapped( &data->window_rect ))
+        if (data->whole_window && X11DRV_is_window_rect_mapped( &data->window_rect ))
         {
             X11DRV_set_wm_hints( display, data );
             if (!data->mapped)
             {
-                if (!data->managed && is_window_managed( hwnd, SWP_NOACTIVATE, &data->window_rect ))
-                {
-                    TRACE( "making win %p/%lx managed\n", hwnd, data->whole_window );
-                    data->managed = TRUE;
-                    SetPropA( hwnd, managed_prop, (HANDLE)1 );
-                }
                 TRACE( "mapping win %p\n", hwnd );
                 X11DRV_sync_window_style( display, data );
                 wine_tsx11_lock();
@@ -162,8 +160,6 @@ void X11DRV_SetWindowStyle( HWND hwnd, DWORD old_style )
                 data->mapped = TRUE;
             }
         }
-        /* we don't unmap windows, that causes trouble with the window manager */
-        invalidate_dce( hwnd, &data->window_rect );
     }
 
     if (changed & WS_DISABLED)




More information about the wine-cvs mailing list