From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e9edc0022c8..d779c031978 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3086,6 +3086,17 @@ BOOL X11DRV_GetWindowStyleMasks( HWND hwnd, UINT style, UINT ex_style, UINT *sty }
+static BOOL get_desired_wm_state( DWORD style, const struct window_rects *rects ) +{ + if (style & WS_VISIBLE) + { + if (style & WS_MINIMIZE) return IconicState; + if (is_window_rect_mapped( &rects->window )) return NormalState; + } + return WithdrawnState; +} + + /*********************************************************************** * WindowPosChanged (X11DRV.@) */ @@ -3160,23 +3171,11 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN #endif }
- if ((new_style & WS_VISIBLE) && - ((new_style & WS_MINIMIZE) || is_window_rect_mapped( &new_rects->window ))) + window_set_wm_state( data, get_desired_wm_state( new_style, new_rects ), activate ); + if (!data->wm_state_serial && data->pending_state.wm_state != WithdrawnState) { - if (!(old_style & WS_VISIBLE)) - { - window_set_wm_state( data, (new_style & WS_MINIMIZE) ? IconicState : NormalState, activate ); - } - else if ((swp_flags & SWP_STATECHANGED) && ((old_style ^ new_style) & WS_MINIMIZE)) - { - window_set_wm_state( data, (new_style & WS_MINIMIZE) ? IconicState : NormalState, activate ); - update_net_wm_states( data ); - } - else - { - if (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)) set_wm_hints( data ); - update_net_wm_states( data ); - } + if (swp_flags & (SWP_FRAMECHANGED | SWP_STATECHANGED)) set_wm_hints( data ); + update_net_wm_states( data ); }
XFlush( data->display ); /* make sure changes are done before we start painting again */
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index d779c031978..e8e01a7f053 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3145,9 +3145,6 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN (!(new_style & WS_MINIMIZE) && !is_window_rect_mapped( &new_rects->window ) && is_window_rect_mapped( &old_rects.window ))) { window_set_wm_state( data, WithdrawnState, FALSE ); - release_win_data( data ); - if (was_fullscreen) NtUserClipCursor( NULL ); - if (!(data = get_win_data( hwnd ))) return; } }
@@ -3178,8 +3175,13 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN update_net_wm_states( data ); }
+ /* if window was fullscreen and is being hidden, release cursor clipping */ + was_fullscreen &= data->desired_state.wm_state != NormalState; + XFlush( data->display ); /* make sure changes are done before we start painting again */ release_win_data( data ); + + if (was_fullscreen) NtUserClipCursor( NULL ); }
/* check if the window icon should be hidden (i.e. moved off-screen) */
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e8e01a7f053..2322d1a11e4 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3104,7 +3104,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN const struct window_rects *new_rects, struct window_surface *surface ) { struct x11drv_win_data *data; - UINT ex_style = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ), new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ), old_style; + UINT ex_style = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ), new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); struct window_rects old_rects; BOOL is_managed, was_fullscreen, activate = !(swp_flags & SWP_NOACTIVATE);
@@ -3113,11 +3113,6 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN if (!(data = get_win_data( hwnd ))) return; if (is_managed) window_set_managed( data, TRUE );
- old_style = new_style & ~(WS_VISIBLE | WS_MINIMIZE | WS_MAXIMIZE); - if (data->desired_state.wm_state != WithdrawnState) old_style |= WS_VISIBLE; - if (data->desired_state.wm_state == IconicState) old_style |= WS_MINIMIZE; - if (data->desired_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) old_style |= WS_MAXIMIZE; - old_rects = data->rects; was_fullscreen = data->is_fullscreen; data->rects = *new_rects; @@ -3139,15 +3134,6 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN return; }
- if (old_style & WS_VISIBLE) - { - if (((swp_flags & SWP_HIDEWINDOW) && !(new_style & WS_VISIBLE)) || - (!(new_style & WS_MINIMIZE) && !is_window_rect_mapped( &new_rects->window ) && is_window_rect_mapped( &old_rects.window ))) - { - window_set_wm_state( data, WithdrawnState, FALSE ); - } - } - /* don't change position if we are about to minimize or maximize a managed window */ if (!(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) {
I don't think the test failures are related, most likely the occasional display mode change race condition that has been taunting me forever.