X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=c1af196b5f08e90403cdd7c47fe0ba96a4515a18;hb=ba1ac214dfdbc0539c922e84c2318c1bf2566c0c;hp=789a0347ddbff2d0f6eaf7e3c7283a7061f3aa78;hpb=75ca8467921f68fdbd6100a1a435a410ef31acb0;p=chaz%2Fopenbox 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; }