From 03738c3f22fe7ab7bf0f77bcb8a22082520d8d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 14 Nov 2024 11:26:41 +0100 Subject: [PATCH] winex11: Wait for pending ConfigureNotify before updating the client state. --- dlls/winex11.drv/event.c | 11 +++++++++-- dlls/winex11.drv/window.c | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 7a9626b4542..70836a887f0 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1104,7 +1104,7 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) struct x11drv_win_data *data; RECT rect; POINT pos = {event->x, event->y}; - UINT config_cmd; + UINT config_cmd, state_cmd; if (!hwnd) return FALSE; if (!(data = get_win_data( hwnd ))) return FALSE; @@ -1123,17 +1123,24 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) SetRect( &rect, pos.x, pos.y, pos.x + event->width, pos.y + event->height ); window_configure_notify( data, event->serial, &rect ); + state_cmd = window_update_client_state( data ); config_cmd = window_update_client_config( data ); rect = window_rect_from_visible( &data->rects, data->current_state.rect ); release_win_data( data ); + if (state_cmd) + { + if (LOWORD(state_cmd) == SC_RESTORE && HIWORD(state_cmd)) NtUserSetActiveWindow( hwnd ); + send_message( hwnd, WM_SYSCOMMAND, LOWORD(state_cmd), 0 ); + } + if (config_cmd) { if (LOWORD(config_cmd) == SC_MOVE) NtUserSetRawWindowPos( hwnd, rect, HIWORD(config_cmd), FALSE ); else send_message( hwnd, WM_SYSCOMMAND, LOWORD(config_cmd), 0 ); } - return !!config_cmd; + return config_cmd || state_cmd; } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 53220120fb0..7d504aecbcd 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1505,6 +1505,7 @@ UINT window_update_client_state( struct x11drv_win_data *data ) if (data->wm_state_serial) return 0; /* another WM_STATE update is pending, wait for it to complete */ if (data->net_wm_state_serial) return 0; /* another _NET_WM_STATE update is pending, wait for it to complete */ + if (data->configure_serial) return 0; /* another config update is pending, wait for it to complete */ if (data->iconic && data->current_state.wm_state == NormalState) /* restore window */ {