]> Dogcows Code - chaz/openbox/commitdiff
add a means to tell the timer destroy function not to fire when for example freeing...
authorMikael Magnusson <mikachu@comhem.se>
Thu, 17 Aug 2006 20:16:02 +0000 (20:16 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 17 Aug 2006 20:16:02 +0000 (20:16 +0000)
openbox/event.c
openbox/frame.c
openbox/mainloop.c
openbox/mainloop.h
openbox/startupnotify.c

index 7717e25f08db10866a013f89229b7140b6b792de..1efccdbed85bcdeb2ecef6c81a52197d0be57b94 100644 (file)
@@ -724,7 +724,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
             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 gboolean focus_delay_func(gpointer data)
 
 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)
index c55ff290717ab0bd9554d9d1a22437d2c56edc8d..881387b628db2664fa044e787bd9c262109a2f5d 100644 (file)
@@ -556,7 +556,7 @@ void frame_release_client(ObFrame *self, ObClient *client)
     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);
 }
index 9676f07e1d3512b375013c813dffe3ac77001ac7..b59564a2075f192eb05e4e0bc05a8d05e7de892d 100644 (file)
@@ -608,16 +608,18 @@ void ob_main_loop_timeout_remove(ObMainLoop *loop,
     }
 }
 
-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;
+        }
     }
 }
 
index 82aa70ca234924577ed3d83518892aabac102aa7..45cef18205b0b03bf5c0821347c60e9945cb1888 100644 (file)
@@ -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;
 
index f296c76d241b312f493042d530fb01f23542f5ee..0bf15d4a25caba8e7fb1827896cccb816f4155a7 100644 (file)
@@ -176,7 +176,7 @@ static void sn_event_func(SnMonitorEvent *ev, gpointer data)
     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;
This page took 0.030493 seconds and 4 git commands to generate.