From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/driver.c | 2 +- dlls/win32u/window.c | 9 ++++++--- dlls/wineandroid.drv/android.h | 2 +- dlls/wineandroid.drv/window.c | 7 ++----- dlls/winemac.drv/macdrv.h | 2 +- dlls/winemac.drv/surface.c | 6 ++---- dlls/winemac.drv/window.c | 1 - dlls/winewayland.drv/waylanddrv.h | 2 +- dlls/winewayland.drv/window.c | 8 ++------ dlls/winewayland.drv/window_surface.c | 4 ++-- dlls/winex11.drv/bitblt.c | 5 ++--- dlls/winex11.drv/window.c | 1 - dlls/winex11.drv/x11drv.h | 2 +- include/wine/gdi_driver.h | 2 +- 14 files changed, 22 insertions(+), 31 deletions(-)
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 723270f1453..f4d07697444 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -889,7 +889,7 @@ static BOOL nulldrv_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *wi return TRUE; }
-static BOOL nulldrv_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface ) +static BOOL nulldrv_CreateWindowSurface( HWND hwnd, const RECT *visible_rect, struct window_surface **surface ) { return FALSE; } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index caa3b3aa323..994ad204109 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1794,7 +1794,11 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, RECT visible_rect = *window_rect, old_visible_rect, old_window_rect, old_client_rect, extra_rects[3]; struct window_surface *old_surface, *new_surface = NULL;
- needs_surface = user_driver->pWindowPosChanging( hwnd, swp_flags, window_rect, client_rect, &visible_rect ); + if (!user_driver->pWindowPosChanging( hwnd, swp_flags, window_rect, client_rect, &visible_rect )) needs_surface = FALSE; + 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);
if (!parent || parent == get_desktop_window()) { @@ -1802,8 +1806,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, window_surface_add_ref( new_surface ); }
- if (!needs_surface || IsRectEmpty( &visible_rect )) needs_surface = FALSE; /* use default surface */ - else needs_surface = !user_driver->pCreateWindowSurface( hwnd, swp_flags, &visible_rect, &new_surface ); + if (needs_surface) needs_surface = !user_driver->pCreateWindowSurface( hwnd, &visible_rect, &new_surface );
get_window_rects( hwnd, COORDS_SCREEN, &old_window_rect, NULL, get_thread_dpi() ); if (IsRectEmpty( &valid_rects[0] )) valid_rects = NULL; diff --git a/dlls/wineandroid.drv/android.h b/dlls/wineandroid.drv/android.h index 72be3c4f5a8..9cdaf88f174 100644 --- a/dlls/wineandroid.drv/android.h +++ b/dlls/wineandroid.drv/android.h @@ -102,7 +102,7 @@ extern BOOL ANDROID_CreateLayeredWindow( HWND hwnd, const RECT *window_rect, COL 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_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface ); +extern BOOL ANDROID_CreateWindowSurface( HWND hwnd, const RECT *visible_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, const RECT *visible_rect, const RECT *valid_rects, diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 764b202d6e5..fed4d941c77 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1149,7 +1149,6 @@ BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_re if (!data && !(data = create_win_data( hwnd, window_rect, client_rect ))) return FALSE; /* use default surface */
if (data->parent) goto done; /* use default surface */ - if (swp_flags & SWP_HIDEWINDOW) 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 */
@@ -1164,7 +1163,7 @@ done: /*********************************************************************** * ANDROID_CreateWindowSurface */ -BOOL ANDROID_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface ) +BOOL ANDROID_CreateWindowSurface( HWND hwnd, const RECT *visible_rect, struct window_surface **surface ) { struct android_win_data *data; RECT surface_rect; @@ -1173,7 +1172,7 @@ BOOL ANDROID_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible BYTE alpha; BOOL layered = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED;
- TRACE( "hwnd %p, swp_flags %08x, visible %s, surface %p\n", hwnd, swp_flags, wine_dbgstr_rect( visible_rect ), surface ); + TRACE( "hwnd %p, visible %s, surface %p\n", hwnd, wine_dbgstr_rect( visible_rect ), surface );
if (!(data = get_win_data( hwnd ))) return TRUE; /* use default surface */ if (!get_surface_rect( visible_rect, &surface_rect )) goto done; /* use default surface */ @@ -1189,8 +1188,6 @@ BOOL ANDROID_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible goto done; } } - if (!(swp_flags & SWP_SHOWWINDOW) && !(NtUserGetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) - goto done;
if (!layered || !NtUserGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags )) flags = 0; if (!(flags & LWA_ALPHA)) alpha = 255; diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 811947f723c..93d549afd95 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -151,7 +151,7 @@ extern void macdrv_UpdateLayeredWindow(HWND hwnd, const RECT *window_rect, COLOR 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_CreateWindowSurface(HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface); +extern BOOL macdrv_CreateWindowSurface(HWND hwnd, const RECT *visible_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, const RECT *visible_rect, const RECT *valid_rects, diff --git a/dlls/winemac.drv/surface.c b/dlls/winemac.drv/surface.c index 02421904986..8bc4d012f5f 100644 --- a/dlls/winemac.drv/surface.c +++ b/dlls/winemac.drv/surface.c @@ -295,13 +295,12 @@ static RECT get_surface_rect(const RECT *visible_rect) /*********************************************************************** * CreateWindowSurface (MACDRV.@) */ -BOOL macdrv_CreateWindowSurface(HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface) +BOOL macdrv_CreateWindowSurface(HWND hwnd, const RECT *visible_rect, struct window_surface **surface) { struct macdrv_win_data *data; - DWORD style = NtUserGetWindowLongW(hwnd, GWL_STYLE); RECT surface_rect;
- TRACE("hwnd %p, swp_flags %08x, visible %s, surface %p\n", hwnd, swp_flags, wine_dbgstr_rect(visible_rect), surface); + TRACE("hwnd %p, visible %s, surface %p\n", hwnd, wine_dbgstr_rect(visible_rect), surface);
if (!(data = get_win_data(hwnd))) return TRUE; /* use default surface */
@@ -320,7 +319,6 @@ BOOL macdrv_CreateWindowSurface(HWND hwnd, UINT swp_flags, const RECT *visible_r goto done; } } - else if (!(swp_flags & SWP_SHOWWINDOW) && !(style & WS_VISIBLE)) goto done;
*surface = create_surface(data->hwnd, data->cocoa_window, &surface_rect, data->surface, FALSE);
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 7c40af2ee28..9c35e76aff0 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1965,7 +1965,6 @@ BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, const RECT *window_rect wine_dbgstr_rect(visible_rect));
if (!data->cocoa_window) goto done; /* use default surface */ - if (swp_flags & SWP_HIDEWINDOW) goto done; /* use default surface */ if (data->ulw_layered) goto done; /* use default surface */
ret = TRUE; diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index d0a8977f887..d8d56b0873c 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -361,7 +361,7 @@ void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, 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_CreateWindowSurface(HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface); +BOOL WAYLAND_CreateWindowSurface(HWND hwnd, const RECT *visible_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 060a25d50c6..71840eefa3b 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -431,7 +431,7 @@ BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, const RECT *window_rec { struct wayland_win_data *data = wayland_win_data_get(hwnd); HWND parent; - BOOL visible, ret = FALSE; + 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), @@ -440,11 +440,7 @@ BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, const RECT *window_rec if (!data && !(data = wayland_win_data_create(hwnd, window_rect, client_rect))) return FALSE; /* use default surface */
parent = NtUserGetAncestor(hwnd, GA_PARENT); - visible = ((NtUserGetWindowLongW(hwnd, GWL_STYLE) & WS_VISIBLE) || - (swp_flags & SWP_SHOWWINDOW)) && - !(swp_flags & SWP_HIDEWINDOW); - - if ((parent && parent != NtUserGetDesktopWindow()) || !visible) goto done; /* use default surface */ + if ((parent && parent != NtUserGetDesktopWindow())) goto done; /* use default surface */
ret = TRUE;
diff --git a/dlls/winewayland.drv/window_surface.c b/dlls/winewayland.drv/window_surface.c index 9377b05b4ce..84dba7c1882 100644 --- a/dlls/winewayland.drv/window_surface.c +++ b/dlls/winewayland.drv/window_surface.c @@ -521,12 +521,12 @@ void wayland_window_surface_update_wayland_surface(struct window_surface *window /*********************************************************************** * WAYLAND_CreateWindowSurface */ -BOOL WAYLAND_CreateWindowSurface(HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface) +BOOL WAYLAND_CreateWindowSurface(HWND hwnd, const RECT *visible_rect, struct window_surface **surface) { struct wayland_win_data *data; RECT surface_rect;
- TRACE("hwnd %p, swp_flags %08x, visible %s, surface %p\n", hwnd, swp_flags, wine_dbgstr_rect(visible_rect), surface); + TRACE("hwnd %p, visible %s, surface %p\n", hwnd, wine_dbgstr_rect(visible_rect), surface);
if (!(data = wayland_win_data_get(hwnd))) return TRUE; /* use default surface */
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 4fce6cbd363..79b62bb163f 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -2201,7 +2201,7 @@ static BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rect ) /*********************************************************************** * CreateWindowSurface (X11DRV.@) */ -BOOL X11DRV_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface ) +BOOL X11DRV_CreateWindowSurface( HWND hwnd, const RECT *visible_rect, struct window_surface **surface ) { struct x11drv_win_data *data; RECT surface_rect; @@ -2209,7 +2209,7 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_ COLORREF key; BOOL layered = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED;
- TRACE( "hwnd %p, swp_flags %08x, visible %s, surface %p\n", hwnd, swp_flags, wine_dbgstr_rect( visible_rect ), surface ); + TRACE( "hwnd %p, visible %s, surface %p\n", hwnd, wine_dbgstr_rect( visible_rect ), surface );
if (!(data = get_win_data( hwnd ))) return TRUE; /* use default surface */
@@ -2232,7 +2232,6 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_ goto done; } } - else if (!(swp_flags & SWP_SHOWWINDOW) && !(NtUserGetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) goto done;
if (!layered || !NtUserGetLayeredWindowAttributes( hwnd, &key, NULL, &flags ) || !(flags & LWA_COLORKEY)) key = CLR_INVALID; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c3455d5301f..24a0aa8e523 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2614,7 +2614,6 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, const RECT *window_rec X11DRV_window_to_X_rect( data, visible_rect, window_rect, client_rect );
if (!data->whole_window && !data->embedded) goto done; /* use default surface */ - if (swp_flags & SWP_HIDEWINDOW) 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 */
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 523cdfc23dc..4fd62f7c219 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -246,7 +246,7 @@ extern void X11DRV_UpdateLayeredWindow( HWND hwnd, const RECT *window_rect, COLO 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_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_rect, struct window_surface **surface ); +extern BOOL X11DRV_CreateWindowSurface( HWND hwnd, const RECT *visible_rect, struct window_surface **surface ); extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *rectWindow, const RECT *rectClient, const RECT *visible_rect, const RECT *valid_rects, diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 5ee77e25f28..a71acb6965c 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -338,7 +338,7 @@ struct user_driver_funcs void (*pUpdateLayeredWindow)(HWND,const RECT *,COLORREF,BYTE,UINT); LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM); BOOL (*pWindowPosChanging)(HWND,UINT,const RECT *,const RECT *,RECT *); - BOOL (*pCreateWindowSurface)(HWND,UINT,const RECT *,struct window_surface**); + BOOL (*pCreateWindowSurface)(HWND,const RECT *,struct window_surface**); void (*pWindowPosChanged)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *, const RECT *,struct window_surface*); /* system parameters */