From: Alex Henrie Subject: [PATCH] winex11: Don't put a default icon on modal dialogs. Message-Id: <1458706210-9699-1-git-send-email-alexhenrie24@gmail.com> Date: Tue, 22 Mar 2016 22:10:10 -0600 Fixes https://bugs.winehq.org/show_bug.cgi?id=29336 when using the xfwm4 window manager. A test program is attached to the bug report. Signed-off-by: Alex Henrie --- dlls/winex11.drv/window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 4789f98..63d256a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -274,7 +274,7 @@ static unsigned long get_mwm_decorations( struct x11drv_win_data *data, if ((style & WS_CAPTION) == WS_CAPTION) { ret |= MWM_DECOR_TITLE | MWM_DECOR_BORDER; - if (style & WS_SYSMENU) ret |= MWM_DECOR_MENU; + if ((style & WS_SYSMENU) && data->icon_pixmap) ret |= MWM_DECOR_MENU; if (style & WS_MINIMIZEBOX) ret |= MWM_DECOR_MINIMIZE; if (style & WS_MAXIMIZEBOX) ret |= MWM_DECOR_MAXIMIZE; } @@ -603,7 +603,8 @@ static void fetch_icon_data( HWND hwnd, HICON icon_big, HICON icon_small ) { icon_big = (HICON)SendMessageW( hwnd, WM_GETICON, ICON_BIG, 0 ); if (!icon_big) icon_big = (HICON)GetClassLongPtrW( hwnd, GCLP_HICON ); - if (!icon_big) icon_big = LoadIconW( 0, (LPWSTR)IDI_WINLOGO ); + if (!icon_big && !(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_DLGMODALFRAME)) + icon_big = LoadIconW( 0, (LPWSTR)IDI_WINLOGO ); } if (!icon_small) { @@ -611,7 +612,7 @@ static void fetch_icon_data( HWND hwnd, HICON icon_big, HICON icon_small ) if (!icon_small) icon_small = (HICON)GetClassLongPtrW( hwnd, GCLP_HICONSM ); } - if (!GetIconInfo(icon_big, &ii)) return; + if (!GetIconInfo(icon_small, &ii) && !GetIconInfo(icon_big, &ii)) return; hDC = CreateCompatibleDC(0); bits = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size ); -- 2.7.4