From: Alex Schwartz <alexschwartz01@gmail.com> --- dlls/win32u/driver.c | 3 ++- dlls/win32u/window.c | 2 +- dlls/winewayland.drv/waylanddrv.h | 3 ++- dlls/winewayland.drv/window.c | 25 ++++--------------------- dlls/winex11.drv/window.c | 3 ++- dlls/winex11.drv/x11drv.h | 3 ++- include/wine/gdi_driver.h | 4 +++- 7 files changed, 16 insertions(+), 27 deletions(-) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 60aba702d1a..657b9237eb2 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -891,7 +891,8 @@ 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, - const struct window_rects *new_rects, struct window_surface *surface ) + const struct window_rects *new_rects, struct window_surface *surface, + HICON (*get_window_icon_info)(HWND, UINT, HICON, ICONINFO*) ) { } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 1464d45697e..b7fd97c43fc 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2345,7 +2345,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru if (owner_hint) owner_hint = NtUserGetAncestor(owner_hint, GA_ROOT); user_driver->pWindowPosChanged( hwnd, insert_after, owner_hint, swp_flags, &monitor_rects, - get_driver_window_surface( new_surface, raw_dpi ) ); + get_driver_window_surface( new_surface, raw_dpi ), get_window_icon_info ); update_client_surfaces( toplevel ); } diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index 7ab1f58ba64..16f5f14fc96 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -452,7 +452,8 @@ LRESULT WAYLAND_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam, const POINT 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, - const struct window_rects *new_rects, struct window_surface *surface); + const struct window_rects *new_rects, struct window_surface *surface, + HICON (*get_window_icon_info)(HWND, UINT, HICON, ICONINFO*)); 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); UINT WAYLAND_VulkanInit(UINT version, void *vulkan_handle, const struct vulkan_driver_funcs **driver_funcs); diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index 590fd39af19..75a0569f34d 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -433,29 +433,12 @@ BOOL WAYLAND_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const str return TRUE; } -static HICON get_icon_info(HICON icon, ICONINFO *ii) -{ - return icon && NtUserGetIconInfo(icon, ii, NULL, NULL, NULL, 0) ? icon : NULL; -} - -static HICON get_window_icon(HWND hwnd, UINT type, HICON icon, ICONINFO *ret) -{ - if ((icon = get_icon_info( icon, ret ))) return icon; - if ((icon = get_icon_info( (HICON)send_message( hwnd, WM_GETICON, type, 0 ), ret ))) return icon; - if ((icon = get_icon_info( (HICON)NtUserGetClassLongPtrW( hwnd, GCLP_HICON ), ret ))) return icon; - if (type == ICON_BIG) - { - icon = LoadImageW( 0, (const WCHAR *)IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); - return get_icon_info( icon, ret ); - } - return NULL; -} - /*********************************************************************** * WAYLAND_WindowPosChanged */ void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UINT swp_flags, - const struct window_rects *new_rects, struct window_surface *surface) + const struct window_rects *new_rects, struct window_surface *surface, + HICON (*get_window_icon_info)(HWND, UINT, HICON, ICONINFO*)) { HWND toplevel = NtUserGetAncestor(hwnd, GA_ROOT); struct wayland_surface *toplevel_surface; @@ -509,8 +492,8 @@ void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UIN { HICON big, small; ICONINFO ii, ii_small; - big = get_window_icon(hwnd, ICON_BIG, 0, &ii); - small = get_window_icon(hwnd, ICON_SMALL, 0, &ii_small); + big = get_window_icon_info(hwnd, ICON_BIG, 0, &ii); + small = get_window_icon_info(hwnd, ICON_SMALL, 0, &ii_small); if((data = wayland_win_data_get(hwnd))) { diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index d256674c9c1..21e126b76d5 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3249,7 +3249,8 @@ 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, - const struct window_rects *new_rects, struct window_surface *surface ) + const struct window_rects *new_rects, struct window_surface *surface, + HICON (*get_window_icon_info)(HWND, UINT, HICON, ICONINFO*) ) { struct x11drv_win_data *data; UINT ex_style = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ), new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 9232988c9c7..694eef499dc 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -255,7 +255,8 @@ extern BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *sur 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, - const struct window_rects *new_rects, struct window_surface *surface ); + const struct window_rects *new_rects, struct window_surface *surface, + HICON (*get_window_icon_info)(HWND, UINT, HICON, ICONINFO*) ); extern BOOL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, UINT flags ); extern LRESULT X11DRV_WintabProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, void *buffer ); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 81932436963..826905c71fa 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -427,7 +427,9 @@ 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,const struct window_rects*,struct window_surface*); + void (*pWindowPosChanged)(HWND,HWND,HWND,UINT,const struct window_rects*,struct window_surface*, + HICON (*get_window_icon_info)(HWND, UINT, HICON, ICONINFO*) + ); /* system parameters */ BOOL (*pSystemParametersInfo)(UINT,UINT,void*,UINT); /* wintab support */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9830