diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2009-07-05 22:27:25 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2009-09-19 15:03:12 +0200 |
| commit | 308478e4a5f4dc76d69395dda8a9bc42cb69eec4 (patch) | |
| tree | 54ec31d91428b2a7d3e4c7bdf902fe182abfc25d /openbox/client.c | |
| parent | 3f72b9d67f21781e513a9c058e8624b8b86b92ea (diff) | |
| parent | ba1ac214dfdbc0539c922e84c2318c1bf2566c0c (diff) | |
Merge branch 'backport' into work
Conflicts:
openbox/actions/desktop.c
openbox/client.c
openbox/event.c
openbox/extensions.c
openbox/popup.c
openbox/screen.c
parser/parse.c
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/openbox/client.c b/openbox/client.c index d98ce642..38dc7c1a 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -233,7 +233,12 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug("Window type: %d", self->type); ob_debug("Window group: 0x%x", self->group?self->group->leader:0); - ob_debug("Window name: %s class: %s", self->name, self->class); + ob_debug("Window name: %s class: %s role: %s", self->name, self->class, self->role); + + /* per-app settings override stuff from client_get_all, and return the + settings for other uses too. the returned settings is a shallow copy, + that needs to be freed with g_free(). */ + settings = client_get_settings_state(self); /* now we have all of the window's information so we can set this up. do this before creating the frame, so it can tell that we are still @@ -255,10 +260,6 @@ void client_manage(Window window, ObPrompt *prompt) time now */ grab_server(FALSE); - /* per-app settings override stuff from client_get_all, and return the - settings for other uses too. the returned settings is a shallow copy, - that needs to be freed with g_free(). */ - settings = client_get_settings_state(self); /* the session should get the last say though */ client_restore_session_state(self); @@ -3538,19 +3539,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(obt_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(obt_display, &e); + } + + return ret; +} + gboolean client_validate(ObClient *self) { XEvent e; XSync(obt_display, FALSE); /* get all events on the server */ - if (XCheckTypedWindowEvent(obt_display, self->window, DestroyNotify, &e) || - XCheckTypedWindowEvent(obt_display, self->window, UnmapNotify, &e)) - { + if (XCheckTypedWindowEvent(obt_display, self->window, DestroyNotify, &e)) { XPutBackEvent(obt_display, &e); return FALSE; } + if (!client_validate_unmap(self, 0)) + return FALSE; + return TRUE; } |
