]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
off by one caused clients to be resized a little during a move
[chaz/openbox] / openbox / event.c
index 0510dab29e9f7d2ad912c3294966071bec2caaf3..d7c80949c87d7944a5d5250fb99ca4988335b398 100644 (file)
 #include <X11/Xatom.h>
 #include <glib.h>
 
-#ifdef USE_LIBSN
-#  include <libsn/sn.h>
-#endif
-
 #ifdef HAVE_SYS_SELECT_H
 #  include <sys/select.h>
 #endif
@@ -96,16 +92,6 @@ static void ice_watch(IceConn conn, IcePointer data, Bool opening,
 }
 #endif
 
-#ifdef USE_LIBSN
-static void sn_handler(const XEvent *e, gpointer display)
-{
-    XEvent ec;
-    ec = *e;
-    sn_display_process_event(display, &ec);
-}
-#endif
-
-
 void event_startup(gboolean reconfig)
 {
     if (reconfig) return;
@@ -141,10 +127,6 @@ void event_startup(gboolean reconfig)
     IceAddConnectionWatch(ice_watch, NULL);
 #endif
 
-#ifdef USE_LIBSN
-    ob_main_loop_x_add(ob_main_loop, sn_handler, ob_sn_display, NULL);
-#endif
-
     client_add_destructor(focus_delay_client_dest);
 }
 
@@ -663,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;
@@ -713,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);
@@ -1194,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.025381 seconds and 4 git commands to generate.