winex11: Wait for pending _NET_WM_STATE before updating the client state.

This commit is contained in:
Rémi Bernon 2024-11-14 11:26:41 +01:00 committed by Alexandre Julliard
parent 03457ece24
commit 8bbc193178
Notes: Alexandre Julliard 2024-11-18 23:18:45 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6569
2 changed files with 12 additions and 1 deletions

View file

@ -1247,12 +1247,20 @@ static void handle_xembed_info_notify( HWND hwnd, XPropertyEvent *event )
static void handle_net_wm_state_notify( HWND hwnd, XPropertyEvent *event ) static void handle_net_wm_state_notify( HWND hwnd, XPropertyEvent *event )
{ {
struct x11drv_win_data *data; struct x11drv_win_data *data;
UINT value = 0; UINT value = 0, state_cmd = 0;
if (!(data = get_win_data( hwnd ))) return; if (!(data = get_win_data( hwnd ))) return;
if (event->state == PropertyNewValue) value = get_window_net_wm_state( event->display, event->window ); if (event->state == PropertyNewValue) value = get_window_net_wm_state( event->display, event->window );
window_net_wm_state_notify( data, event->serial, value ); window_net_wm_state_notify( data, event->serial, value );
state_cmd = window_update_client_state( data );
release_win_data( data ); 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 );
}
} }
/*********************************************************************** /***********************************************************************

View file

@ -1503,6 +1503,9 @@ UINT window_update_client_state( struct x11drv_win_data *data )
if (!data->managed) return 0; /* unmanaged windows are managed by the Win32 side */ if (!data->managed) return 0; /* unmanaged windows are managed by the Win32 side */
if (!data->mapped) return 0; /* ignore state changes on invisible windows */ if (!data->mapped) return 0; /* ignore state changes on invisible windows */
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->iconic && data->current_state.wm_state == NormalState) /* restore window */ if (data->iconic && data->current_state.wm_state == NormalState) /* restore window */
{ {
data->iconic = FALSE; data->iconic = FALSE;