From 82db73cc4344cf4e8a3757fb1ec50be77e3bc9d8 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 3 Jul 2009 21:19:54 +0200 Subject: Fix for #3715, app settings applied too late. This caused problems for placing windows with decor turned off, the placement code thought they had it on. --- openbox/client.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 03bbfe48..016a660f 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -315,6 +315,11 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug("Window group: 0x%x\n", self->group?self->group->leader:0); ob_debug("Window name: %s class: %s\n", self->name, self->class); + /* 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 mapping and doesn't go applying things right away */ @@ -335,10 +340,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); -- cgit v1.2.3 From 75ca8467921f68fdbd6100a1a435a410ef31acb0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 3 Jul 2009 21:20:30 +0200 Subject: Show window role in the debug message for name/class too. --- openbox/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 016a660f..789a0347 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -313,7 +313,7 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug("Window type: %d\n", self->type); ob_debug("Window group: 0x%x\n", self->group?self->group->leader:0); - ob_debug("Window name: %s class: %s\n", self->name, self->class); + ob_debug("Window name: %s class: %s role: %s\n", 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, -- cgit v1.2.3 From d48e720c3977d1d64620108589380919b430affe Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 3 Jul 2009 18:58:21 -0400 Subject: client_validate should return FALSE only for UnmapNotifies that will cause the window to become unmanaged --- openbox/client.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'openbox/client.c') 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; } -- cgit v1.2.3