add a means to tell the timer destroy function not to fire when for example freeing its client frame
Mikael Magnusson mikachu@comhem.se
5 files changed,
12 insertions(+),
9 deletions(-)
M
openbox/event.c
→
openbox/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.c
→
openbox/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.c
→
openbox/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.h
→
openbox/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.c
→
openbox/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;