From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/driver.c | 2 +- dlls/win32u/window.c | 9 +++++++-- dlls/wineandroid.drv/android.h | 3 ++- dlls/wineandroid.drv/window.c | 9 +++++---- dlls/winemac.drv/macdrv.h | 3 ++- dlls/winemac.drv/window.c | 8 +++++--- dlls/winewayland.drv/waylanddrv.h | 3 ++- dlls/winewayland.drv/window.c | 9 +++++---- dlls/winex11.drv/window.c | 8 +++++++- dlls/winex11.drv/x11drv.h | 3 ++- include/wine/gdi_driver.h | 4 ++-- 11 files changed, 40 insertions(+), 21 deletions(-)
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 4bc49619970..76e717648d6 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -884,7 +884,7 @@ static LRESULT nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM return 0; }
-static BOOL nulldrv_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) +static BOOL nulldrv_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) { return TRUE; } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index b63392b1f2d..f065fd7309e 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1834,11 +1834,16 @@ static BOOL get_default_window_surface( HWND hwnd, const RECT *surface_rect, str static struct window_surface *create_window_surface( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect, RECT *surface_rect ) { - BOOL needs_surface, layered, ulw_layered = FALSE; + BOOL shaped, needs_surface, layered, ulw_layered = FALSE; struct window_surface *new_surface; + RECT dummy; + HRGN shape; + + if (get_window_region( hwnd, FALSE, &shape, &dummy )) shaped = FALSE; + else if ((shaped = !!shape)) NtGdiDeleteObjectApp( shape );
*visible_rect = *window_rect; - if (!user_driver->pWindowPosChanging( hwnd, swp_flags, window_rect, client_rect, visible_rect )) needs_surface = FALSE; + if (!user_driver->pWindowPosChanging( hwnd, swp_flags, shaped, window_rect, client_rect, 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); diff --git a/dlls/wineandroid.drv/android.h b/dlls/wineandroid.drv/android.h index 3f0329bac10..54062b04db0 100644 --- a/dlls/wineandroid.drv/android.h +++ b/dlls/wineandroid.drv/android.h @@ -101,7 +101,8 @@ extern UINT ANDROID_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ); extern BOOL ANDROID_CreateLayeredWindow( HWND hwnd, const RECT *surface_rect, COLORREF color_key, struct window_surface **surface ); extern LRESULT ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ); -extern BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ); +extern BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect ); extern BOOL ANDROID_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct window_surface **surface ); extern void ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 73f2c0b9897..5da40b4a2f1 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1059,14 +1059,15 @@ static struct android_win_data *create_win_data( HWND hwnd, const RECT *window_r /*********************************************************************** * ANDROID_WindowPosChanging */ -BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) +BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect ) { struct android_win_data *data = get_win_data( hwnd ); BOOL ret = FALSE;
- TRACE( "win %p window %s client %s style %08x flags %08x\n", - hwnd, wine_dbgstr_rect(window_rect), wine_dbgstr_rect(client_rect), - (int)NtUserGetWindowLongW( hwnd, GWL_STYLE ), swp_flags ); + TRACE( "hwnd %p, swp_flags %04x, shaped %u, window_rect %s, client_rect %s, visible_rect %s\n", + hwnd, swp_flags, shaped, wine_dbgstr_rect(window_rect), wine_dbgstr_rect(client_rect), + wine_dbgstr_rect(visible_rect) );
if (!data && !(data = create_win_data( hwnd, window_rect, client_rect ))) return FALSE; /* use default surface */
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 8824f3385fa..8b9e908bc1a 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -150,7 +150,8 @@ extern BOOL macdrv_CreateLayeredWindow(HWND hwnd, const RECT *window_rect, COLOR extern void macdrv_UpdateLayeredWindow(HWND hwnd, const RECT *window_rect, COLORREF color_key, BYTE alpha, UINT flags); extern LRESULT macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); -extern BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect); +extern BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect); extern BOOL macdrv_CreateWindowSurface(HWND hwnd, const RECT *surface_rect, struct window_surface **surface); extern void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 0bbb7e4fc34..0784b0e4e39 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1947,17 +1947,19 @@ LRESULT macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) /*********************************************************************** * WindowPosChanging (MACDRV.@) */ -BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect) +BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect) { struct macdrv_win_data *data = get_win_data(hwnd); DWORD style = NtUserGetWindowLongW(hwnd, GWL_STYLE); BOOL ret = FALSE;
- TRACE("%p swp %04x window %s client %s visible %s\n", hwnd, - swp_flags, wine_dbgstr_rect(window_rect), wine_dbgstr_rect(client_rect), + TRACE("hwnd %p, swp_flags %04x, shaped %u, window_rect %s, client_rect %s, visible_rect %s\n", + hwnd, swp_flags, shaped, wine_dbgstr_rect(window_rect), wine_dbgstr_rect(client_rect), wine_dbgstr_rect(visible_rect));
if (!data && !(data = macdrv_create_win_data(hwnd, window_rect, client_rect))) return FALSE; /* use default surface */ + data->shaped = shaped;
macdrv_window_to_mac_rect(data, style, visible_rect, window_rect, client_rect); TRACE("visible_rect %s -> %s\n", wine_dbgstr_rect(window_rect), diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index d4ef01a8a1e..efb13821696 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -360,7 +360,8 @@ void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, const RECT *visible_rect, const RECT *valid_rects, struct window_surface *surface); -BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect); +BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect); BOOL WAYLAND_CreateWindowSurface(HWND hwnd, const RECT *surface_rect, struct window_surface **surface); UINT WAYLAND_VulkanInit(UINT version, void *vulkan_handle, const struct vulkan_driver_funcs **driver_funcs); struct opengl_funcs *WAYLAND_wine_get_wgl_driver(UINT version); diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index c1fb5c6e0b5..dc6a6b7e03a 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -427,15 +427,16 @@ void WAYLAND_DestroyWindow(HWND hwnd) /*********************************************************************** * WAYLAND_WindowPosChanging */ -BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect) +BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect) { struct wayland_win_data *data = wayland_win_data_get(hwnd); HWND parent; BOOL ret = FALSE;
- TRACE("hwnd %p window %s client %s visible %s flags %08x\n", - hwnd, wine_dbgstr_rect(window_rect), wine_dbgstr_rect(client_rect), - wine_dbgstr_rect(visible_rect), swp_flags); + TRACE("hwnd %p, swp_flags %04x, shaped %u, window_rect %s, client_rect %s, visible_rect %s\n", + hwnd, swp_flags, shaped, wine_dbgstr_rect(window_rect), wine_dbgstr_rect(client_rect), + wine_dbgstr_rect(visible_rect));
if (!data && !(data = wayland_win_data_create(hwnd, window_rect, client_rect))) return FALSE; /* use default surface */
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7416164bbb1..5c949525598 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2579,12 +2579,18 @@ done: /*********************************************************************** * WindowPosChanging (X11DRV.@) */ -BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) +BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect ) { struct x11drv_win_data *data = get_win_data( hwnd ); BOOL ret = FALSE;
+ TRACE( "hwnd %p, swp_flags %04x, shaped %u, window_rect %s, client_rect %s, visible_rect %s\n", + hwnd, swp_flags, shaped, wine_dbgstr_rect(window_rect), wine_dbgstr_rect(client_rect), + wine_dbgstr_rect(visible_rect) ); + if (!data && !(data = X11DRV_create_win_data( hwnd, window_rect, client_rect ))) return FALSE; /* use default surface */ + data->shaped = shaped;
/* check if we need to switch the window to managed */ if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, window_rect )) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 1078270eefe..fc57c72cb79 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -245,7 +245,8 @@ extern BOOL X11DRV_CreateLayeredWindow( HWND hwnd, const RECT *surface_rect, COL extern void X11DRV_UpdateLayeredWindow( HWND hwnd, const RECT *window_rect, COLORREF color_key, 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, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ); +extern BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const RECT *window_rect, + const RECT *client_rect, RECT *visible_rect ); extern BOOL X11DRV_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct window_surface **surface ); extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *rectWindow, const RECT *rectClient, diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index b1b07f8dc72..ef2d284cfe1 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -179,7 +179,7 @@ struct gdi_dc_funcs };
/* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 86 +#define WINE_GDI_DRIVER_VERSION 87
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -340,7 +340,7 @@ struct user_driver_funcs BOOL (*pCreateLayeredWindow)(HWND,const RECT *,COLORREF,struct window_surface **); void (*pUpdateLayeredWindow)(HWND,const RECT *,COLORREF,BYTE,UINT); LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM); - BOOL (*pWindowPosChanging)(HWND,UINT,const RECT *,const RECT *,RECT *); + BOOL (*pWindowPosChanging)(HWND,UINT,BOOL,const RECT *,const RECT *,RECT *); BOOL (*pCreateWindowSurface)(HWND,const RECT *,struct window_surface**); void (*pWindowPosChanged)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *, const RECT *,struct window_surface*);