]> Dogcows Code - chaz/openbox/commitdiff
use the ob_main_loop_timeout_remove_data to only remove one timer
authorDana Jansens <danakj@orodu.net>
Wed, 3 Sep 2003 21:18:19 +0000 (21:18 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 3 Sep 2003 21:18:19 +0000 (21:18 +0000)
openbox/event.c

index e3efb289bd72e24d1cc419d7402f207afefb4ac1..d7c80949c87d7944a5d5250fb99ca4988335b398 100644 (file)
@@ -645,9 +645,11 @@ static void event_handle_client(ObClient *client, XEvent *e)
         case OB_FRAME_CONTEXT_FRAME:
             /* XXX if doing a 'reconfigure' make sure you kill this timer,
                maybe all timers.. */
-            if (config_focus_delay) {
+            if (config_focus_delay && client == focus_delay_client) {
+                ob_main_loop_timeout_remove_data(ob_main_loop,
+                                                 focus_delay_func,
+                                                 focus_delay_client);
                 focus_delay_client = NULL;
-                ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func);
             }
         default:
             break;
@@ -695,7 +697,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
                         ob_main_loop_timeout_add(ob_main_loop,
                                                  config_focus_delay,
                                                  focus_delay_func,
-                                                 NULL, NULL);
+                                                 client, NULL);
                         focus_delay_client = client;
                     } else
                         client_focus(client);
@@ -1176,7 +1178,8 @@ static void focus_delay_client_dest(gpointer data)
 {
     ObClient *c = data;
     if (c == focus_delay_client) {
+        ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func,
+                                         focus_delay_client);
         focus_delay_client = NULL;
-        ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func);
     }
 }
This page took 0.024636 seconds and 4 git commands to generate.