[RFC] winex11: Don't put a default icon on modal dialogs.
Alex Henrie
alexhenrie24 at gmail.com
Tue Mar 15 23:31:28 CDT 2016
Fixes https://bugs.winehq.org/show_bug.cgi?id=29336 when using the xfwm4
window manager.
Could some other developers take a look at this patch? It passes the
test program attached to the bug report, but I am not sure that it is
the right way.
---
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.3
More information about the wine-devel
mailing list