diff options
author | Danny Baumann <dannybaumann@web.de> | 2008-10-20 09:56:28 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2008-10-21 09:58:56 +0200 |
commit | 087952bad6c4f7c5dab27ada7b9591915950fec2 (patch) | |
tree | d967d051f4468ce5147c87acd0ef20a6fc40de10 /src | |
parent | 6e672eae05c655b6b1e044f9c8c3493c025edce9 (diff) |
Handle "cleared WM hints" case properly.
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/src/window.c b/src/window.c index 801fa15a..9d803402 100644 --- a/src/window.c +++ b/src/window.c @@ -315,34 +315,46 @@ void updateWmHints (CompWindow *w) { XWMHints *hints; + long dFlags = 0; + Bool iconChanged = FALSE; + + if (w->hints) + dFlags = w->hints->flags; + + w->inputHint = TRUE; hints = XGetWMHints (w->screen->display->display, w->id); if (hints) { - long dFlags = 0; - Bool iconChanged = FALSE; - - if (w->hints) - dFlags = w->hints->flags; dFlags ^= hints->flags; - iconChanged = (dFlags & (IconPixmapHint | IconMaskHint)) || - (w->hints && (hints->flags & IconPixmapHint) && - w->hints->icon_pixmap != hints->icon_pixmap) || - (w->hints && (hints->flags & IconMaskHint) && - w->hints->icon_mask != hints->icon_mask); - - if (iconChanged) - freeWindowIcons (w); - if (hints->flags & InputHint) w->inputHint = hints->input; if (w->hints) - XFree (w->hints); - - w->hints = hints; + { + if ((hints->flags & IconPixmapHint) && + (w->hints->icon_pixmap != hints->icon_pixmap)) + { + iconChanged = TRUE; + } + else if ((hints->flags & IconMaskHint) && + (w->hints->icon_mask != hints->icon_mask)) + { + iconChanged = TRUE; + } + } } + + iconChanged |= (dFlags & (IconPixmapHint | IconMaskHint)); + + if (iconChanged) + freeWindowIcons (w); + + if (w->hints) + XFree (w->hints); + + w->hints = hints; } void |