Commit 8913182b authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 026974f5
......@@ -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 );
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment