all repos — openbox @ acfa2af3c2eacd099869cc5aebdcfa1241214e8b

openbox fork - make it a bit more like ryudo

use the right list in client_add_hide_notify, rename destructor to destroy_notify which is really what it is, and is more consistant now that there are 2 notifies
Dana Jansens danakj@orodu.net
commit

acfa2af3c2eacd099869cc5aebdcfa1241214e8b

parent

9f22554b6a1e7113b4ff86061327d9d0b0d87760

M openbox/client.copenbox/client.c

@@ -64,7 +64,7 @@ } ClientCallback;

GList *client_list = NULL; -static GSList *client_destructors = NULL; +static GSList *client_destroy_notifies = NULL; static GSList *client_hide_notifies = NULL; static void client_get_all(ObClient *self, gboolean real);

@@ -92,7 +92,7 @@ static void client_present(ObClient *self, gboolean here, gboolean raise);

static GSList *client_search_all_top_parents_internal(ObClient *self, gboolean bylayer, ObStackingLayer layer); -static void client_call_callbacks(ObClient *self, GSList *list); +static void client_call_notifies(ObClient *self, GSList *list); void client_startup(gboolean reconfig) {

@@ -106,7 +106,7 @@ {

if (reconfig) return; } -static void client_call_callbacks(ObClient *self, GSList *list) +static void client_call_notifies(ObClient *self, GSList *list) { GSList *it;

@@ -116,23 +116,24 @@ d->func(self, d->data);

} } -void client_add_destructor(ObClientCallback func, gpointer data) +void client_add_destroy_notify(ObClientCallback func, gpointer data) { ClientCallback *d = g_new(ClientCallback, 1); d->func = func; d->data = data; - client_destructors = g_slist_prepend(client_destructors, d); + client_destroy_notifies = g_slist_prepend(client_destroy_notifies, d); } -void client_remove_destructor(ObClientCallback func) +void client_remove_destroy_notify(ObClientCallback func) { GSList *it; - for (it = client_destructors; it; it = g_slist_next(it)) { + for (it = client_destroy_notifies; it; it = g_slist_next(it)) { ClientCallback *d = it->data; if (d->func == func) { g_free(d); - client_destructors = g_slist_delete_link(client_destructors, it); + client_destroy_notifies = + g_slist_delete_link(client_destroy_notifies, it); break; } }

@@ -143,7 +144,7 @@ {

ClientCallback *d = g_new(ClientCallback, 1); d->func = func; d->data = data; - client_hide_notifies = g_slist_prepend(client_destructors, d); + client_hide_notifies = g_slist_prepend(client_hide_notifies, d); } void client_remove_hide_notify(ObClientCallback func)

@@ -600,7 +601,7 @@ influence */

if (STRUT_EXISTS(self->strut)) screen_update_areas(); - client_call_callbacks(self, client_destructors); + client_call_notifies(self, client_destroy_notifies); /* tell our parent(s) that we're gone */ if (self->transient_for == OB_TRAN_GROUP) { /* transient of group */

@@ -2416,7 +2417,7 @@ {

if (!client_should_show(self)) { frame_hide(self->frame); - client_call_callbacks(self, client_hide_notifies); + client_call_notifies(self, client_hide_notifies); } /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it

@@ -2435,7 +2436,7 @@ }

else { frame_hide(self->frame); - client_call_callbacks(self, client_hide_notifies); + client_call_notifies(self, client_hide_notifies); } /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
M openbox/client.hopenbox/client.h

@@ -309,8 +309,8 @@

/* Callback functions */ /*! Get notified when the client is unmanaged */ -void client_add_destructor(ObClientCallback func, gpointer data); -void client_remove_destructor(ObClientCallback func); +void client_add_destroy_notify(ObClientCallback func, gpointer data); +void client_remove_destroy_notify(ObClientCallback func); /*! Get notified when the client is hidden */ void client_add_hide_notify(ObClientCallback func, gpointer data);
M openbox/client_list_combined_menu.copenbox/client_list_combined_menu.c

@@ -143,7 +143,7 @@

void client_list_combined_menu_startup(gboolean reconfig) { if (!reconfig) - client_add_destructor(client_dest, NULL); + client_add_destroy_notify(client_dest, NULL); combined_menu = menu_new(MENU_NAME, _("Windows"), TRUE, NULL); menu_set_update_func(combined_menu, self_update);

@@ -153,5 +153,5 @@

void client_list_combined_menu_shutdown(gboolean reconfig) { if (!reconfig) - client_remove_destructor(client_dest); + client_remove_destroy_notify(client_dest); }
M openbox/client_list_menu.copenbox/client_list_menu.c

@@ -194,7 +194,7 @@ {

ObMenu *menu; if (!reconfig) - client_add_destructor(client_dest, NULL); + client_add_destroy_notify(client_dest, NULL); menu = menu_new(MENU_NAME, _("Desktops"), TRUE, NULL); menu_set_update_func(menu, self_update);

@@ -203,5 +203,5 @@

void client_list_menu_shutdown(gboolean reconfig) { if (!reconfig) - client_remove_destructor(client_dest); + client_remove_destroy_notify(client_dest); }
M openbox/event.copenbox/event.c

@@ -131,7 +131,7 @@ #ifdef USE_SM

IceAddConnectionWatch(ice_watch, NULL); #endif - client_add_destructor(focus_delay_client_dest, NULL); + client_add_destroy_notify(focus_delay_client_dest, NULL); } void event_shutdown(gboolean reconfig)

@@ -142,7 +142,7 @@ #ifdef USE_SM

IceRemoveConnectionWatch(ice_watch, NULL); #endif - client_remove_destructor(focus_delay_client_dest); + client_remove_destroy_notify(focus_delay_client_dest); } static Window event_get_window(XEvent *e)
M openbox/focus.copenbox/focus.c

@@ -67,7 +67,7 @@ static gboolean valid_focus_target(ObClient *ft,

gboolean all_desktops, gboolean dock_windows, gboolean desktop_windows); -static void focus_cycle_destructor(ObClient *client, gpointer data); +static void focus_cycle_destroy_notify(ObClient *client, gpointer data); static void focus_tried_hide_notify(ObClient *client, gpointer data); static Window createWindow(Window parent, gulong mask,

@@ -86,8 +86,8 @@

if (!reconfig) { XSetWindowAttributes attr; - client_add_destructor(focus_cycle_destructor, NULL); - client_add_destructor(focus_tried_hide_notify, NULL); + client_add_destroy_notify(focus_cycle_destroy_notify, NULL); + client_add_destroy_notify(focus_tried_hide_notify, NULL); client_add_hide_notify(focus_tried_hide_notify, NULL); /* start with nothing focused */

@@ -141,8 +141,8 @@ {

icon_popup_free(focus_cycle_popup); if (!reconfig) { - client_remove_destructor(focus_cycle_destructor); - client_remove_destructor(focus_tried_hide_notify); + client_remove_destroy_notify(focus_cycle_destroy_notify); + client_remove_destroy_notify(focus_tried_hide_notify); client_remove_hide_notify(focus_tried_hide_notify); /* reset focus to root */

@@ -417,7 +417,7 @@ client_icon(showtarget, 48, 48));

g_free(showtext); } -static void focus_cycle_destructor(ObClient *client, gpointer data) +static void focus_cycle_destroy_notify(ObClient *client, gpointer data) { /* end cycling if the target disappears. CurrentTime is fine, time won't be used
M openbox/keyboard.copenbox/keyboard.c

@@ -324,13 +324,13 @@ grab_keys(TRUE);

popup = popup_new(FALSE); if (!reconfig) - client_add_destructor(keyboard_interactive_end_client, NULL); + client_add_destroy_notify(keyboard_interactive_end_client, NULL); } void keyboard_shutdown(gboolean reconfig) { if (!reconfig) - client_remove_destructor(keyboard_interactive_end_client); + client_remove_destroy_notify(keyboard_interactive_end_client); if (istate.active) keyboard_interactive_end(0, TRUE, 0, TRUE);
M openbox/mainloop.copenbox/mainloop.c

@@ -282,7 +282,7 @@

loop->run = TRUE; loop->running = TRUE; - client_add_destructor(ob_main_loop_client_destroy, loop); + client_add_destroy_notify(ob_main_loop_client_destroy, loop); while (loop->run) { if (loop->signal_fired) {

@@ -365,7 +365,7 @@ fd_handle_foreach, &selset);

} } - client_remove_destructor(ob_main_loop_client_destroy); + client_remove_destroy_notify(ob_main_loop_client_destroy); loop->running = FALSE; }
M openbox/menu.copenbox/menu.c

@@ -110,13 +110,13 @@

g_assert(menu_parse_state.parent == NULL); if (!reconfig) - client_add_destructor(client_dest, NULL); + client_add_destroy_notify(client_dest, NULL); } void menu_shutdown(gboolean reconfig) { if (!reconfig) - client_remove_destructor(client_dest); + client_remove_destroy_notify(client_dest); parse_shutdown(menu_parse_inst); menu_parse_inst = NULL;
M openbox/moveresize.copenbox/moveresize.c

@@ -70,7 +70,7 @@ {

popup = popup_new(FALSE); if (!reconfig) - client_add_destructor(client_dest, NULL); + client_add_destroy_notify(client_dest, NULL); } void moveresize_shutdown(gboolean reconfig)

@@ -78,7 +78,7 @@ {

if (!reconfig) { if (moveresize_in_progress) moveresize_end(FALSE); - client_remove_destructor(client_dest); + client_remove_destroy_notify(client_dest); } popup_free(popup);