X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmainloop.c;h=62261dde0af6e52dd2b215aea6a12f8c659e8cd2;hb=939fbcfd31e07a6e0f1cdbfcef9b04f63e6af700;hp=e6914f89e8f446b26f71cf3eee0973163262a5f9;hpb=8612fcfb99f4ed97f49c3617fd2ae291877c8c8e;p=chaz%2Fopenbox diff --git a/openbox/mainloop.c b/openbox/mainloop.c index e6914f89..62261dde 100644 --- a/openbox/mainloop.c +++ b/openbox/mainloop.c @@ -99,6 +99,7 @@ struct _ObMainLoopTimer gulong delay; GSourceFunc func; gpointer data; + GEqualFunc equal; GDestroyNotify destroy; /* The timer needs to be freed */ @@ -585,12 +586,14 @@ void ob_main_loop_timeout_add(ObMainLoop *loop, gulong microseconds, GSourceFunc handler, gpointer data, + GEqualFunc cmp, GDestroyNotify notify) { ObMainLoopTimer *t = g_new(ObMainLoopTimer, 1); t->delay = microseconds; t->func = handler; t->data = data; + t->equal = cmp; t->destroy = notify; t->del_me = FALSE; g_get_current_time(&loop->now); @@ -619,7 +622,7 @@ void ob_main_loop_timeout_remove_data(ObMainLoop *loop, GSourceFunc handler, 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->equal(t->data, data)) { t->del_me = TRUE; if (cancel_dest) t->destroy = NULL;