Alexandre Julliard : winex11: Check for need to make window managed when WS_VISIBLE is set outside of SetWindowPos .

Alexandre Julliard julliard at winehq.org
Thu Jan 24 07:20:59 CST 2008


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jan 24 10:21:07 2008 +0100

winex11: Check for need to make window managed when WS_VISIBLE is set outside of SetWindowPos.

---

 dlls/winex11.drv/desktop.c |    1 +
 dlls/winex11.drv/window.c  |    2 ++
 dlls/winex11.drv/winpos.c  |   10 +++++++---
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
index 23a6675..96d050a 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -108,6 +108,7 @@ static LONG X11DRV_desktop_SetCurrentMode(int mode)
 void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height )
 {
     root_window = win;
+    managed_mode = 0;  /* no managed windows in desktop mode */
     max_width = screen_width;
     max_height = screen_height;
     xinerama_init( width, height );
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index c21836d..2177e10 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -79,6 +79,8 @@ BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rect )
 {
     DWORD style, ex_style;
 
+    if (!managed_mode) return FALSE;
+
     /* child windows are not managed */
     style = GetWindowLongW( hwnd, GWL_STYLE );
     if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) return FALSE;
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index e5d16ee..13b73f3 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -148,6 +148,12 @@ void X11DRV_SetWindowStyle( HWND hwnd, DWORD old_style )
             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();
@@ -368,9 +374,7 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
     }
 
     /* check if we need to switch the window to managed */
-    if (!data->managed && data->whole_window && managed_mode &&
-        root_window == DefaultRootWindow( display ) &&
-        is_window_managed( hwnd, swp_flags, rectWindow ))
+    if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, rectWindow ))
     {
         TRACE( "making win %p/%lx managed\n", hwnd, data->whole_window );
         data->managed = TRUE;




More information about the wine-cvs mailing list