all repos — openbox @ 7b7f158088fa548791922b7cf133e507d3873656

openbox fork - make it a bit more like ryudo

add a means to tell the timer destroy function not to fire when for example freeing its client frame
Mikael Magnusson mikachu@comhem.se
commit

7b7f158088fa548791922b7cf133e507d3873656

parent

1b4ff4e93f8bc312a862d3f08afeb0f4809527ae

5 files changed, 12 insertions(+), 9 deletions(-)

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

@@ -724,7 +724,7 @@ case OB_FRAME_CONTEXT_FRAME:

if (config_focus_follow && config_focus_delay) ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func, - client); + client, TRUE); break; default: break;

@@ -1287,7 +1287,7 @@ }

static void focus_delay_client_dest(ObClient *client, gpointer data) { - ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func, client); + ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func, client, TRUE); } static void event_client_dest(ObClient *client, gpointer data)
M openbox/frame.copenbox/frame.c

@@ -556,7 +556,7 @@ g_hash_table_remove(window_map, &self->rgrip);

g_hash_table_remove(window_map, &self->tlresize); g_hash_table_remove(window_map, &self->trresize); - ob_main_loop_timeout_remove_data(ob_main_loop, flash_timeout, self); + ob_main_loop_timeout_remove_data(ob_main_loop, flash_timeout, self, TRUE); frame_free(self); }
M openbox/mainloop.copenbox/mainloop.c

@@ -608,16 +608,18 @@ t->del_me = TRUE;

} } -void ob_main_loop_timeout_remove_data(ObMainLoop *loop, - GSourceFunc handler, - gpointer data) +void ob_main_loop_timeout_remove_data(ObMainLoop *loop, GSourceFunc handler, + gpointer data, gboolean cancel_dest) { GSList *it; for (it = loop->timers; it; it = g_slist_next(it)) { ObMainLoopTimer *t = it->data; - if (t->func == handler && t->data == data) + if (t->func == handler && t->data == data) { t->del_me = TRUE; + if (cancel_dest) + t->destroy = NULL; + } } }
M openbox/mainloop.hopenbox/mainloop.h

@@ -65,7 +65,8 @@ void ob_main_loop_timeout_remove(ObMainLoop *loop,

GSourceFunc handler); void ob_main_loop_timeout_remove_data(ObMainLoop *loop, GSourceFunc handler, - gpointer data); + gpointer data, + gboolean cancel_dest); struct _ObAction;
M openbox/startupnotify.copenbox/startupnotify.c

@@ -176,7 +176,7 @@ case SN_MONITOR_EVENT_COMPLETED:

case SN_MONITOR_EVENT_CANCELED: if ((d = wait_find(sn_startup_sequence_get_id(seq)))) { d->feedback = FALSE; - ob_main_loop_timeout_remove_data(ob_main_loop, sn_wait_timeout, d); + ob_main_loop_timeout_remove_data(ob_main_loop, sn_wait_timeout, d, FALSE); change = TRUE; } break;