From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 28 +++++++++++++++++++++++++--- dlls/winex11.drv/window.c | 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 70836a887f0..cc4869c4666 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1203,7 +1203,8 @@ static int get_window_xembed_info( Display *display, Window window ) static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL update_window ) { struct x11drv_win_data *data; - UINT value = 0, state_cmd = 0; + UINT value = 0, state_cmd = 0, config_cmd = 0; + RECT rect;
if (!(data = get_win_data( hwnd ))) return; if (event->state == PropertyNewValue) value = get_window_wm_state( event->display, event->window ); @@ -1229,7 +1230,12 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL updat break; }
- if (update_window) state_cmd = window_update_client_state( data ); + if (update_window) + { + 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 );
@@ -1238,6 +1244,12 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL updat 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 ); + } }
static void handle_xembed_info_notify( HWND hwnd, XPropertyEvent *event ) @@ -1254,13 +1266,17 @@ static void handle_xembed_info_notify( HWND hwnd, XPropertyEvent *event ) static void handle_net_wm_state_notify( HWND hwnd, XPropertyEvent *event ) { struct x11drv_win_data *data; - UINT value = 0, state_cmd = 0; + UINT value = 0, state_cmd = 0, config_cmd = 0; + RECT rect;
if (!(data = get_win_data( hwnd ))) return; if (event->state == PropertyNewValue) value = get_window_net_wm_state( event->display, event->window ); window_net_wm_state_notify( data, event->serial, value );
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) @@ -1268,6 +1284,12 @@ static void handle_net_wm_state_notify( HWND hwnd, XPropertyEvent *event ) 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 ); + } }
/*********************************************************************** diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7d504aecbcd..4bbf71b7780 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1547,6 +1547,8 @@ UINT window_update_client_config( struct x11drv_win_data *data ) if (!data->mapped) return 0; /* ignore config changes on invisible windows */ if (data->iconic) return 0; /* ignore config changes on minimized 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->configure_serial) return 0; /* another config update is pending, wait for it to complete */
if ((old_style & WS_CAPTION) == WS_CAPTION || !data->is_fullscreen)