From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/driver.c | 2 +- dlls/win32u/window.c | 22 ++++++++++++++++------ dlls/wineandroid.drv/window.c | 2 +- dlls/winemac.drv/macdrv.h | 2 +- dlls/winemac.drv/window.c | 7 ++++--- dlls/winewayland.drv/waylanddrv.h | 2 +- dlls/winewayland.drv/window.c | 4 ++-- dlls/winex11.drv/window.c | 4 ++-- dlls/winex11.drv/x11drv.h | 2 +- include/wine/gdi_driver.h | 3 ++- 10 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 75d45a708b1..6bfdbb04829 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -890,7 +890,7 @@ static void nulldrv_MoveWindowBits( HWND hwnd, const struct window_rects *old_re { }
-static void nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +static void nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface ) { } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 56621e63b1b..1e86d21ae07 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2145,6 +2145,12 @@ HICON get_window_icon_info( HWND hwnd, UINT type, HICON icon, ICONINFO *ret ) return NULL; }
+static BOOL is_fullscreen( const MONITORINFO *info, const RECT *rect ) +{ + return rect->left <= info->rcMonitor.left && rect->right >= info->rcMonitor.right && + rect->top <= info->rcMonitor.top && rect->bottom >= info->rcMonitor.bottom; +} + /*********************************************************************** * apply_window_pos * @@ -2156,8 +2162,8 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru struct window_rects monitor_rects; WND *win; HWND owner_hint, surface_win = 0, parent = NtUserGetAncestor( hwnd, GA_PARENT ); - BOOL ret, is_fullscreen, is_layered, is_child, need_icons = FALSE; UINT raw_dpi, monitor_dpi, dpi = get_thread_dpi(); + BOOL ret, is_layered, is_child, need_icons = FALSE; struct window_rects old_rects; RECT extra_rects[3]; struct window_surface *old_surface; @@ -2165,7 +2171,6 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru ICONINFO ii, ii_small;
is_layered = new_surface && new_surface->alpha_mask; - is_fullscreen = is_window_rect_full_screen( &new_rects->visible, get_thread_dpi() ); is_child = parent && parent != NtUserGetDesktopWindow();
if (is_child) monitor_dpi = get_win_monitor_dpi( parent, &raw_dpi ); @@ -2185,9 +2190,6 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru valid_rects = NULL; }
- if (is_child) monitor_rects = map_dpi_window_rects( *new_rects, dpi, raw_dpi ); - else monitor_rects = map_window_rects_virt_to_raw( *new_rects, dpi ); - SERVER_START_REQ( set_window_pos ) { req->handle = wine_server_user_handle( hwnd ); @@ -2249,6 +2251,14 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru icon_small = win->hIconSmall2 ? win->hIconSmall2 : win->hIconSmall; win->has_icons = need_icons = TRUE; } + + if (is_child) monitor_rects = map_dpi_window_rects( *new_rects, dpi, raw_dpi ); + else + { + MONITORINFO monitor_info = monitor_info_from_rect( new_rects->window, dpi ); + if (is_fullscreen( &monitor_info, &new_rects->visible )) swp_flags |= WINE_SWP_FULLSCREEN; + monitor_rects = map_window_rects_virt_to_raw( *new_rects, dpi ); + } }
release_win_ptr( win ); @@ -2316,7 +2326,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru if (!owner_hint) owner_hint = NtUserWindowFromPoint(new_rects->window.left - 1, new_rects->window.top - 1); if (owner_hint) owner_hint = NtUserGetAncestor(owner_hint, GA_ROOT);
- user_driver->pWindowPosChanged( hwnd, insert_after, owner_hint, swp_flags, is_fullscreen, &monitor_rects, + user_driver->pWindowPosChanged( hwnd, insert_after, owner_hint, swp_flags, &monitor_rects, get_driver_window_surface( new_surface, raw_dpi ) ); update_client_surfaces( hwnd );
diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 81be65a065c..4a131540c19 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1056,7 +1056,7 @@ BOOL ANDROID_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_r /*********************************************************************** * ANDROID_WindowPosChanged */ -void ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +void ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface ) { struct android_win_data *data; diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 5b9515f086f..129616eee5a 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -150,7 +150,7 @@ extern void macdrv_SetLayeredWindowAttributes(HWND hwnd, COLORREF key, BYTE alph extern BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const struct window_rects *rects); extern BOOL macdrv_GetWindowStyleMasks(HWND hwnd, UINT style, UINT ex_style, UINT *style_mask, UINT *ex_style_mask); extern BOOL macdrv_CreateWindowSurface(HWND hwnd, BOOL layered, const RECT *surface_rect, struct window_surface **surface); -extern void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +extern void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface); extern void macdrv_DestroyCursorIcon(HCURSOR cursor); extern BOOL macdrv_GetCursorPos(LPPOINT pos); diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 10e719068ac..5787492250a 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1589,9 +1589,10 @@ BOOL macdrv_GetWindowStyleMasks(HWND hwnd, UINT style, UINT ex_style, UINT *styl /*********************************************************************** * WindowPosChanged (MACDRV.@) */ -void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface) { + BOOL fullscreen = swp_flags & WINE_SWP_FULLSCREEN; struct macdrv_thread_data *thread_data; struct macdrv_win_data *data; unsigned int new_style = NtUserGetWindowLongW(hwnd, GWL_STYLE); @@ -1604,8 +1605,8 @@ void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT old_rects = data->rects; data->rects = *new_rects;
- TRACE("win %p/%p new_rects %s style %08x flags %08x fullscreen %u surface %p\n", hwnd, data->cocoa_window, - debugstr_window_rects(new_rects), new_style, swp_flags, fullscreen, surface); + TRACE("win %p/%p new_rects %s style %08x flags %08x surface %p\n", hwnd, data->cocoa_window, + debugstr_window_rects(new_rects), new_style, swp_flags, surface);
if (!data->cocoa_window) goto done;
diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index 2ec87c768dd..7ab1f58ba64 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -451,7 +451,7 @@ void WAYLAND_SetWindowText(HWND hwnd, LPCWSTR text); LRESULT WAYLAND_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam, const POINT *pos); UINT WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manager, void *param); LRESULT WAYLAND_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); -void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface); BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const struct window_rects *rects); BOOL WAYLAND_CreateWindowSurface(HWND hwnd, BOOL layered, const RECT *surface_rect, struct window_surface **surface); diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index 7816f832900..939be6e3c08 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -436,14 +436,14 @@ BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const str /*********************************************************************** * WAYLAND_WindowPosChanged */ -void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface) { HWND toplevel = NtUserGetAncestor(hwnd, GA_ROOT); struct wayland_surface *toplevel_surface; struct wayland_client_surface *client; struct wayland_win_data *data, *toplevel_data; - BOOL managed; + BOOL managed, fullscreen = swp_flags & WINE_SWP_FULLSCREEN;
TRACE("hwnd %p new_rects %s after %p flags %08x\n", hwnd, debugstr_window_rects(new_rects), insert_after, swp_flags);
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a042ac9bc52..251492af8d6 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3114,13 +3114,13 @@ static BOOL get_desired_wm_state( DWORD style, const struct window_rects *rects /*********************************************************************** * WindowPosChanged (X11DRV.@) */ -void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface ) { struct x11drv_win_data *data; UINT ex_style = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ), new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); struct window_rects old_rects; - BOOL is_managed, was_fullscreen, activate = !(swp_flags & SWP_NOACTIVATE); + BOOL is_managed, was_fullscreen, activate = !(swp_flags & SWP_NOACTIVATE), fullscreen = !!(swp_flags & WINE_SWP_FULLSCREEN);
if ((is_managed = is_window_managed( hwnd, swp_flags, fullscreen ))) make_owner_managed( hwnd );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 63d6a316642..9983d62b114 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -247,7 +247,7 @@ extern BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *swp_ 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 ); -extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, BOOL fullscreen, +extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface ); extern BOOL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, UINT flags ); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index cdc838d36d8..b4880bb52eb 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -353,6 +353,7 @@ struct gdi_device_manager };
#define WINE_DM_UNSUPPORTED 0x80000000 +#define WINE_SWP_FULLSCREEN 0x80000000
struct vulkan_driver_funcs; struct opengl_driver_funcs; @@ -424,7 +425,7 @@ struct user_driver_funcs BOOL (*pGetWindowStateUpdates)(HWND,UINT*,UINT*,RECT*,HWND*); BOOL (*pCreateWindowSurface)(HWND,BOOL,const RECT *,struct window_surface**); void (*pMoveWindowBits)(HWND,const struct window_rects *,const struct window_rects *,const RECT *); - void (*pWindowPosChanged)(HWND,HWND,HWND,UINT,BOOL,const struct window_rects*,struct window_surface*); + void (*pWindowPosChanged)(HWND,HWND,HWND,UINT,const struct window_rects*,struct window_surface*); /* system parameters */ BOOL (*pSystemParametersInfo)(UINT,UINT,void*,UINT); /* vulkan support */