diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 23a66756845..96d050abdc1 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 c21836d2d97..2177e10ef6b 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 e5d16ee8c28..13b73f392f7 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;