all repos — openbox @ 5e5fdb1666ac4877ca4d26f5ca565a299bc4cc42

openbox fork - make it a bit more like ryudo

make the client destructor a GDestroyNotify
Dana Jansens danakj@orodu.net
commit

5e5fdb1666ac4877ca4d26f5ca565a299bc4cc42

parent

2573b51904e04f366ba4f6b858caa2471cdcb53f

4 files changed, 9 insertions(+), 11 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -60,12 +60,12 @@ void client_shutdown()

{ } -void client_add_destructor(ObClientDestructorFunc func) +void client_add_destructor(GDestroyNotify func) { client_destructors = g_slist_prepend(client_destructors, (gpointer)func); } -void client_remove_destructor(ObClientDestructorFunc func) +void client_remove_destructor(GDestroyNotify func) { client_destructors = g_slist_remove(client_destructors, (gpointer)func); }

@@ -423,7 +423,7 @@ }

} for (it = client_destructors; it; it = g_slist_next(it)) { - ObClientDestructorFunc func = (ObClientDestructorFunc) it->data; + GDestroyNotify func = (GDestroyNotify) it->data; func(self); }
M openbox/client.hopenbox/client.h

@@ -243,10 +243,8 @@

void client_startup(); void client_shutdown(); -typedef void (*ObClientDestructorFunc)(ObClient *c); - -void client_add_destructor(ObClientDestructorFunc func); -void client_remove_destructor(ObClientDestructorFunc func); +void client_add_destructor(GDestroyNotify func); +void client_remove_destructor(GDestroyNotify func); /*! Manages all existing windows */ void client_manage_all();
M openbox/menu.copenbox/menu.c

@@ -55,11 +55,11 @@ g_free(p);

return loaded; } -static void client_dest(ObClient *c) +static void client_dest(gpointer client) { /* menus can be associated with a client, so close any that are since we are disappearing now */ - menu_frame_hide_all_client(c); + menu_frame_hide_all_client(client); } void menu_startup()
M openbox/moveresize.copenbox/moveresize.c

@@ -28,9 +28,9 @@ static ObCorner lockcorner;

static Popup *popup = NULL; -static void client_dest(ObClient *c) +static void client_dest(gpointer client) { - if (moveresize_client == c) + if (moveresize_client == client) moveresize_end(TRUE); }