diff options
Diffstat (limited to 'hw/xwin/winmultiwindowicons.c')
-rw-r--r-- | hw/xwin/winmultiwindowicons.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c index 4ac8bffdf..09b9b0412 100644 --- a/hw/xwin/winmultiwindowicons.c +++ b/hw/xwin/winmultiwindowicons.c @@ -70,23 +70,33 @@ winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew) hIcon = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXICON)); hIconSmall = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXSMICON)); + + /* If we got the small, but not the large one swap them */ + if (!hIcon && hIconSmall) { + hIcon = hIconSmall; + hIconSmall = NULL; + } } - /* If we got the small, but not the large one swap them */ - if (!hIcon && hIconSmall) { - hIcon = hIconSmall; - hIconSmall = NULL; + /* If we still need an icon, use the default one */ + if (!hIcon) { + hIcon = g_hIconX; + hIconSmall = g_hSmallIconX; } - /* Set the large icon */ - hIconOld = (HICON) SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); - /* Delete the old icon if its not the default */ - winDestroyIcon(hIconOld); + if (hIcon) { + /* Set the large icon */ + hIconOld = (HICON) SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); + /* Delete the old icon if its not the default */ + winDestroyIcon(hIconOld); + } - /* Same for the small icon */ - hIconOld = - (HICON) SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); - winDestroyIcon(hIconOld); + if (hIconSmall) { + /* Same for the small icon */ + hIconOld = + (HICON) SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); + winDestroyIcon(hIconOld); + } } void |