diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-08-30 17:46:23 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-08-30 17:46:23 +0000 |
| commit | 8e76e328639ba42cdafa5306f924b0491faec969 (patch) | |
| tree | 286b5d45b2adece699b87455aa9fbfadb7e86aec /openbox/client.c | |
| parent | 2c6c0757fa497f4c1e0648bcbb1927c0fa12862f (diff) | |
add destructor functions for clients that you acn subscribe with, and use these instead of hardcoding special cases in the unmanage code
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/openbox/client.c b/openbox/client.c index e653ed19..aa83e2b6 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -32,7 +32,8 @@ #define CLIENT_NOPROPAGATEMASK (ButtonPressMask | ButtonReleaseMask | \ ButtonMotionMask) -GList *client_list = NULL; +GList *client_list = NULL; +GSList *client_destructors = NULL; static void client_get_all(ObClient *self); static void client_toggle_border(ObClient *self, gboolean show); @@ -58,6 +59,16 @@ void client_shutdown() { } +void client_add_destructor(ObClientDestructorFunc func) +{ + client_destructors = g_slist_prepend(client_destructors, (gpointer)func); +} + +void client_remove_destructor(ObClientDestructorFunc func) +{ + client_destructors = g_slist_remove(client_destructors, (gpointer)func); +} + void client_set_list() { Window *windows, *win_it; @@ -414,13 +425,11 @@ void client_unmanage(ObClient *self) } } - if (moveresize_client == self) - moveresize_end(TRUE); - - /* menus can be associated with a client, so close any that are since - we are disappearing now */ - menu_frame_hide_all_client(self); - + for (it = client_destructors; it; it = g_slist_next(it)) { + ObClientDestructorFunc func = (ObClientDestructorFunc) it->data; + func(self); + } + if (focus_client == self) { XEvent e; |
