summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-03 20:34:14 +0000
committerDana Jansens <danakj@orodu.net>2003-09-03 20:34:14 +0000
commit1df4e327607f7dcf56826928efdddb809d8f1fc3 (patch)
tree47f8b73b6d27204fac8d0c1d2f5881be4fa04d0e /openbox
parentaae074a11affd5c8bbe22b326ddbec323bb85677 (diff)
add ob_main_loop_timeout_remove_data.
make the timeout remove functions remove *all* timeouts that match
Diffstat (limited to 'openbox')
-rw-r--r--openbox/mainloop.c17
-rw-r--r--openbox/mainloop.h3
2 files changed, 17 insertions, 3 deletions
diff --git a/openbox/mainloop.c b/openbox/mainloop.c
index 9df84d34..397f8ae2 100644
--- a/openbox/mainloop.c
+++ b/openbox/mainloop.c
@@ -525,10 +525,21 @@ void ob_main_loop_timeout_remove(ObMainLoop *loop,
for (it = loop->timers; it; it = g_slist_next(it)) {
ObMainLoopTimer *t = it->data;
- if (t->func == handler) {
+ if (t->func == handler)
+ t->del_me = TRUE;
+ }
+}
+
+void ob_main_loop_timeout_remove_data(ObMainLoop *loop,
+ GSourceFunc handler,
+ gpointer data)
+{
+ GSList *it;
+
+ for (it = loop->timers; it; it = g_slist_next(it)) {
+ ObMainLoopTimer *t = it->data;
+ if (t->func == handler && t->data == data)
t->del_me = TRUE;
- break;
- }
}
}
diff --git a/openbox/mainloop.h b/openbox/mainloop.h
index ecbcc389..8e0e5ed6 100644
--- a/openbox/mainloop.h
+++ b/openbox/mainloop.h
@@ -45,6 +45,9 @@ void ob_main_loop_timeout_add(ObMainLoop *loop,
GDestroyNotify notify);
void ob_main_loop_timeout_remove(ObMainLoop *loop,
GSourceFunc handler);
+void ob_main_loop_timeout_remove_data(ObMainLoop *loop,
+ GSourceFunc handler,
+ gpointer data);
void ob_main_loop_run(ObMainLoop *loop);
void ob_main_loop_exit(ObMainLoop *loop);