From: Rémi Bernon rbernon@codeweavers.com
And simply return the SWP flags from GetWindowStateUpdates. --- dlls/win32u/driver.c | 2 +- dlls/win32u/message.c | 12 ++++-------- dlls/winex11.drv/window.c | 14 +++++++------- dlls/winex11.drv/x11drv.h | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 2a269db8c65..75d45a708b1 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -875,7 +875,7 @@ static BOOL nulldrv_GetWindowStyleMasks( HWND hwnd, UINT style, UINT ex_style, U return FALSE; }
-static BOOL nulldrv_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect, HWND *foreground ) +static BOOL nulldrv_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *swp_flags, RECT *rect, HWND *foreground ) { return FALSE; } diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index e8bbe229141..ba6299d3dcd 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2224,11 +2224,11 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR } case WM_WINE_WINDOW_STATE_CHANGED: { - UINT state_cmd, config_cmd; + UINT state_cmd, swp_flags; RECT window_rect; HWND foreground;
- if (!user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &config_cmd, &window_rect, &foreground )) return 0; + if (!user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &swp_flags, &window_rect, &foreground )) return 0; if (foreground) NtUserSetForegroundWindow( foreground ); if (state_cmd) { @@ -2236,15 +2236,11 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR send_message( hwnd, WM_SYSCOMMAND, LOWORD(state_cmd), 0 );
/* state change might have changed the window config already, check again */ - user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &config_cmd, &window_rect, &foreground ); + user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &swp_flags, &window_rect, &foreground ); if (foreground) NtUserSetForegroundWindow( foreground ); if (state_cmd) WARN( "window %p state needs another update, ignoring\n", hwnd ); } - if (config_cmd) - { - if (LOWORD(config_cmd) == SC_MOVE) NtUserSetRawWindowPos( hwnd, window_rect, HIWORD(config_cmd), FALSE ); - else send_message( hwnd, WM_SYSCOMMAND, LOWORD(config_cmd), 0 ); - } + if (swp_flags) NtUserSetRawWindowPos( hwnd, window_rect, swp_flags, FALSE ); return 0; } case WM_WINE_UPDATEWINDOWSTATE: diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index df8f228b483..a042ac9bc52 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1672,19 +1672,19 @@ static UINT window_update_client_config( struct x11drv_win_data *data )
TRACE( "window %p/%lx config changed %s -> %s, flags %#x\n", data->hwnd, data->whole_window, wine_dbgstr_rect(&old_rect), wine_dbgstr_rect(&new_rect), flags ); - return MAKELONG(SC_MOVE, flags); + return flags; }
/*********************************************************************** * GetWindowStateUpdates (X11DRV.@) */ -BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect, HWND *foreground ) +BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *swp_flags, RECT *rect, HWND *foreground ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); struct x11drv_win_data *data; HWND old_foreground;
- *state_cmd = *config_cmd = 0; + *state_cmd = *swp_flags = 0; *foreground = 0;
if (!(old_foreground = NtUserGetForegroundWindow())) old_foreground = NtUserGetDesktopWindow(); @@ -1699,14 +1699,14 @@ BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, if ((data = get_win_data( hwnd ))) { *state_cmd = window_update_client_state( data ); - *config_cmd = window_update_client_config( data ); + *swp_flags = window_update_client_config( data ); *rect = window_rect_from_visible( &data->rects, data->current_state.rect ); release_win_data( data ); }
- if (!*state_cmd && !*config_cmd && !*foreground) return FALSE; - TRACE( "hwnd %p, returning state_cmd %#x, config_cmd %#x, rect %s, foreground %p\n", - hwnd, *state_cmd, *config_cmd, wine_dbgstr_rect(rect), *foreground ); + if (!*state_cmd && !*swp_flags && !*foreground) return FALSE; + TRACE( "hwnd %p, returning state_cmd %#x, swp_flags %#x, rect %s, foreground %p\n", + hwnd, *state_cmd, *swp_flags, wine_dbgstr_rect(rect), *foreground ); return TRUE; }
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index fdd4534a626..63d6a316642 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -243,7 +243,7 @@ extern void X11DRV_UpdateLayeredWindow( HWND hwnd, BYTE alpha, UINT flags ); extern LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ); extern BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const struct window_rects *rects ); extern BOOL X11DRV_GetWindowStyleMasks( HWND hwnd, UINT style, UINT ex_style, UINT *style_mask, UINT *ex_style_mask ); -extern BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect, HWND *foreground ); +extern BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *swp_flags, RECT *rect, HWND *foreground ); extern BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_rect, struct window_surface **surface ); extern void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, const struct window_rects *new_rects, const RECT *valid_rects );