changeset 33544:b71fac188432

Check whether a specific icon is available. If icons are no longer included in the source, but will be read from files, then reading may fail and a particular icon (size) may not be available. This is a preparation for differently sized icons to come.
author ib
date Thu, 16 Jun 2011 17:40:55 +0000
parents 10f9498fada1
children 38aee97cc4fc
files gui/wm/ws.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/wm/ws.c	Thu Jun 16 15:03:18 2011 +0000
+++ b/gui/wm/ws.c	Thu Jun 16 17:40:55 2011 +0000
@@ -1537,6 +1537,7 @@
     Atom iconatom;
     CARD32 data[2];
 
+    if (icon->normal) {
     wm = XGetWMHints(dsp, win);
 
     if (!wm)
@@ -1548,12 +1549,15 @@
 
     XSetWMHints(dsp, win, wm);
     XFree(wm);
+    }
 
+    if (icon->small || icon->normal) {
     iconatom = XInternAtom(dsp, "KWM_WIN_ICON", False);
     data[0]  = (icon->small ? icon->small : icon->normal);
     data[1]  = (icon->small ? icon->small_mask : icon->normal_mask);
 
     XChangeProperty(dsp, win, iconatom, iconatom, 32, PropModeReplace, (unsigned char *)data, 2);
+    }
 
     if (icon->collection) {
         iconatom = XInternAtom(dsp, "_NET_WM_ICON", False);