diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index f7a09092a16..24f89f86b1a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -66,7 +66,7 @@ static const char visual_id_prop[] = "__wine_x11_visual_id"; * * Check if a given window should be managed */ -BOOL is_window_managed( HWND hwnd, const RECT *window_rect ) +BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rect ) { DWORD style, ex_style; @@ -76,6 +76,9 @@ BOOL is_window_managed( HWND hwnd, const RECT *window_rect ) /* child windows are not managed */ style = GetWindowLongW( hwnd, GWL_STYLE ); if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) return FALSE; + /* activated windows are managed */ + if (!(swp_flags & (SWP_NOACTIVATE|SWP_HIDEWINDOW))) return TRUE; + if (hwnd == GetActiveWindow()) return TRUE; /* windows with caption are managed */ if ((style & WS_CAPTION) == WS_CAPTION) return TRUE; /* tool windows are not managed */ diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c index 5499ef0cead..085396c8022 100644 --- a/dlls/winex11.drv/winpos.c +++ b/dlls/winex11.drv/winpos.c @@ -252,9 +252,7 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow, root_window == DefaultRootWindow( display ) && data->whole_window != root_window) { - if (!(swp_flags & (SWP_NOACTIVATE|SWP_HIDEWINDOW)) || - is_window_managed( hwnd, rectWindow ) || - hwnd == GetActiveWindow()) + if (is_window_managed( hwnd, swp_flags, rectWindow )) { TRACE( "making win %p/%lx managed\n", hwnd, data->whole_window ); make_managed = TRUE; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 8594e20696b..15834119ada 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -684,7 +684,7 @@ typedef int (*x11drv_error_callback)( Display *display, XErrorEvent *event, void extern void X11DRV_expect_error( Display *display, x11drv_error_callback callback, void *arg ); extern int X11DRV_check_error(void); -extern BOOL is_window_managed( HWND hwnd, const RECT *window_rect ); +extern BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rect ); extern void X11DRV_set_iconic_state( HWND hwnd ); extern void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect ); extern void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect );