diff options
| author | Dana Jansens <danakj@orodu.net> | 2009-07-03 18:58:21 -0400 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2009-07-04 12:38:53 +0200 |
| commit | d48e720c3977d1d64620108589380919b430affe (patch) | |
| tree | 51cccdca92f48dd87d902808179493e58cb37b30 /openbox/client.c | |
| parent | 75ca8467921f68fdbd6100a1a435a410ef31acb0 (diff) | |
client_validate should return FALSE only for UnmapNotifies that will cause the window to become unmanaged
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/openbox/client.c b/openbox/client.c index 789a0347..c1af196b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3591,18 +3591,38 @@ ObClient *client_search_modal_child(ObClient *self) return NULL; } +static gboolean client_validate_unmap(ObClient *self, int n) +{ + XEvent e; + gboolean ret = TRUE; + + if (XCheckTypedWindowEvent(ob_display, self->window, UnmapNotify, &e)) { + if (n < self->ignore_unmaps) // ignore this one, but look for more + ret = client_validate_unmap(self, n+1); + else + ret = FALSE; // the window is going to become unmanaged + + /* put them back on the event stack so they end up in the same order */ + XPutBackEvent(ob_display, &e); + } + + return ret; +} + gboolean client_validate(ObClient *self) { XEvent e; XSync(ob_display, FALSE); /* get all events on the server */ - if (XCheckTypedWindowEvent(ob_display, self->window, DestroyNotify, &e) || - XCheckTypedWindowEvent(ob_display, self->window, UnmapNotify, &e)) { + if (XCheckTypedWindowEvent(ob_display, self->window, DestroyNotify, &e)) { XPutBackEvent(ob_display, &e); return FALSE; } + if (!client_validate_unmap(self, 0)) + return FALSE; + return TRUE; } |
