From: Rémi Bernon rbernon@codeweavers.com
Checking the style isn't accurate, and we should check the pending state if window is or enters maximized / fullscreen, and the current state for windows exiting maximized / fullscreen, for which wait until the state update is complete before requesting a new size.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57465 --- dlls/winex11.drv/window.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 0052dcc8439..5a216744fab 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1277,28 +1277,17 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat static void window_set_config( struct x11drv_win_data *data, const RECT *new_rect, BOOL above ) { static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); - UINT style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ), mask = 0; + BOOL is_maximized = (data->pending_state.net_wm_state & fullscreen_mask) || (data->current_state.net_wm_state & fullscreen_mask); const RECT *old_rect = &data->pending_state.rect; XWindowChanges changes; + UINT mask = 0;
data->desired_state.rect = *new_rect; if (!data->whole_window) return; /* no window, nothing to update */ if (EqualRect( old_rect, new_rect )) return; /* rects are the same, nothing to update */
- if (data->pending_state.wm_state == NormalState && data->net_wm_state_serial && - !(data->pending_state.net_wm_state & fullscreen_mask) && - (data->current_state.net_wm_state & fullscreen_mask)) - { - /* Some window managers are sending a ConfigureNotify event with the fullscreen size when - * exiting a fullscreen window, with a serial that we cannot predict. Handling that event - * will override the Win32 window size and make the window fullscreen again. - */ - WARN( "window %p/%lx is exiting maximize/fullscreen, delaying request\n", data->hwnd, data->whole_window ); - return; - } - /* resizing a managed maximized window is not allowed */ - if (!(style & WS_MAXIMIZE) || !data->managed) + if (!is_maximized || !data->managed) { changes.width = new_rect->right - new_rect->left; changes.height = new_rect->bottom - new_rect->top;