[PATCH] user32: Fix conditions under which a default window icon is displayed.
Alex Henrie
alexhenrie24 at gmail.com
Fri Mar 11 03:47:31 CST 2016
Fixes https://bugs.winehq.org/show_bug.cgi?id=29336 when "Emulate a
virtual desktop" is checked or "Allow the window manager to decorate
the windows" is unchecked in winecfg.
A test program is attached to the bug report.
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
dlls/user32/nonclient.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index 053353a..113811c 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -168,12 +168,15 @@ static HICON NC_IconForWindow( HWND hwnd )
if (!hIcon) hIcon = (HICON) GetClassLongPtrW( hwnd, GCLP_HICONSM );
if (!hIcon) hIcon = (HICON) GetClassLongPtrW( hwnd, GCLP_HICON );
- /* If there is no hIcon specified and this is a modal dialog,
- * get the default one.
+ /* If there is no icon specified and the window style requires one,
+ * use the Wine logo.
*/
- if (!hIcon && (GetWindowLongW( hwnd, GWL_STYLE ) & DS_MODALFRAME))
+ if (!hIcon && (GetWindowLongW( hwnd, GWL_STYLE ) & WS_SYSMENU) &&
+ !(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_DLGMODALFRAME))
+ {
hIcon = LoadImageW(0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+ }
return hIcon;
}
--
2.7.2
More information about the wine-patches
mailing list