From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/window.c | 7 ++++++- dlls/wineandroid.drv/window.c | 2 -- dlls/winex11.drv/window.c | 16 ---------------- 3 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 994ad204109..b66d3d4d00a 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1798,7 +1798,12 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, else if (IsRectEmpty( &visible_rect )) needs_surface = FALSE; else if (swp_flags & SWP_HIDEWINDOW) needs_surface = FALSE; else if (swp_flags & SWP_SHOWWINDOW) needs_surface = TRUE; - else needs_surface = !!(NtUserGetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE); + else if (!(NtUserGetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) needs_surface = FALSE; + else + { + RECT virtual_rect = get_virtual_screen_rect( get_thread_dpi() ); + needs_surface = intersect_rect( &virtual_rect, &virtual_rect, &visible_rect ); + }
if (!parent || parent == get_desktop_window()) { diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index fed4d941c77..3c5f4c50679 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1139,7 +1139,6 @@ static inline BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rec BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) { struct android_win_data *data = get_win_data( hwnd ); - RECT surface_rect; BOOL ret = FALSE;
TRACE( "win %p window %s client %s style %08x flags %08x\n", @@ -1150,7 +1149,6 @@ BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_re
if (data->parent) goto done; /* use default surface */ if (is_argb_surface( data->surface )) goto done; /* use default surface */ - if (!get_surface_rect( visible_rect, &surface_rect )) goto done; /* use default surface */
ret = TRUE;
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 24a0aa8e523..2a84bc49620 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2576,27 +2576,12 @@ done: }
-static inline BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rect ) -{ - *surface_rect = NtUserGetVirtualScreenRect(); - - if (!intersect_rect( surface_rect, surface_rect, visible_rect )) return FALSE; - OffsetRect( surface_rect, -visible_rect->left, -visible_rect->top ); - surface_rect->left &= ~31; - surface_rect->top &= ~31; - surface_rect->right = max( surface_rect->left + 32, (surface_rect->right + 31) & ~31 ); - surface_rect->bottom = max( surface_rect->top + 32, (surface_rect->bottom + 31) & ~31 ); - return TRUE; -} - - /*********************************************************************** * WindowPosChanging (X11DRV.@) */ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) { struct x11drv_win_data *data = get_win_data( hwnd ); - RECT surface_rect; BOOL ret = FALSE;
if (!data && !(data = X11DRV_create_win_data( hwnd, window_rect, client_rect ))) return FALSE; /* use default surface */ @@ -2615,7 +2600,6 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rec
if (!data->whole_window && !data->embedded) goto done; /* use default surface */ if (data->use_alpha) goto done; /* use default surface */ - if (!get_surface_rect( visible_rect, &surface_rect )) goto done; /* use default surface */
ret = TRUE;