diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2007-03-14 14:17:31 +0000 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@comhem.se> | 2007-03-14 14:17:31 +0000 |
| commit | 768ce7b456fb7455c39bc275b71af381d635ac0a (patch) | |
| tree | 58cd0ba07971339f65e521f59861c5dc07942906 | |
| parent | 5f7ffb00ba0050de28e915f6dcbd711b03eec938 (diff) | |
move stuff around in client_unmanage to maybe make closing windows a bit nicer
| -rw-r--r-- | openbox/client.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/openbox/client.c b/openbox/client.c index 1a0d2531..e7c7f62a 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -498,29 +498,44 @@ void client_unmanage(ObClient *self) g_assert(self != NULL); - keyboard_grab_for_client(self, FALSE); - mouse_grab_for_client(self, FALSE); + /* update the focus lists */ + focus_order_remove(self); + + if (focus_client == self) { + XEvent e; + + /* focus the last focused window on the desktop, and ignore enter + events from the unmap so it doesnt mess with the focus */ + while (XCheckTypedEvent(ob_display, EnterNotify, &e)); + /* remove these flags so we don't end up getting focused in the + fallback! */ + self->can_focus = FALSE; + self->focus_notify = FALSE; + self->modal = FALSE; + client_unfocus(self); + } /* potentially fix focusLast */ if (config_focus_last) grab_pointer(TRUE, OB_CURSOR_NONE); + frame_hide(self->frame); + XFlush(ob_display); + + keyboard_grab_for_client(self, FALSE); + mouse_grab_for_client(self, FALSE); + /* remove the window from our save set */ XChangeSaveSet(ob_display, self->window, SetModeDelete); /* we dont want events no more */ XSelectInput(ob_display, self->window, NoEventMask); - frame_hide(self->frame); - client_list = g_list_remove(client_list, self); stacking_remove(self); g_hash_table_remove(window_map, &self->window); - /* update the focus lists */ - focus_order_remove(self); - - /* once the client is out of the list, update the struts to remove it's + /* once the client is out of the list, update the struts to remove its influence */ if (STRUT_EXISTS(self->strut)) screen_update_areas(); @@ -529,20 +544,6 @@ void client_unmanage(ObClient *self) Destructor *d = it->data; d->func(self, d->data); } - - if (focus_client == self) { - XEvent e; - - /* focus the last focused window on the desktop, and ignore enter - events from the unmap so it doesnt mess with the focus */ - while (XCheckTypedEvent(ob_display, EnterNotify, &e)); - /* remove these flags so we don't end up getting focused in the - fallback! */ - self->can_focus = FALSE; - self->focus_notify = FALSE; - self->modal = FALSE; - client_unfocus(self); - } /* tell our parent(s) that we're gone */ if (self->transient_for == OB_TRAN_GROUP) { /* transient of group */ |
