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

This commit is contained in:
Alexandre Julliard 2008-01-24 10:21:07 +01:00
parent 026974f5be
commit 8913182b89
3 changed files with 10 additions and 3 deletions

View File

@ -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 );

View File

@ -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;

View File

@ -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;