]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
fix compile without startup notification after r5711
[chaz/openbox] / openbox / event.c
index 75cf5d2e6f3471f4ea0e2b59051719285e083568..3aa91c618ffbb14cb667a6434c3ea4b459f55e94 100644 (file)
@@ -1320,11 +1320,8 @@ static gboolean focus_delay_func(gpointer data)
     ObClient *c = data;
 
     if (focus_client != c) {
-        if (client_validate(c)) {
-            client_focus(c);
-            if (config_focus_raise)
-                client_raise(c);
-        }
+        if (client_focus(c) && config_focus_raise)
+            client_raise(c);
     }
     return FALSE; /* no repeat */
 }
@@ -1376,3 +1373,25 @@ void event_ignore_queued_enters()
     }
     g_slist_free(saved);
 }
+
+gboolean event_time_after(Time t1, Time t2)
+{
+    /*
+      Timestamp values wrap around (after about 49.7 days). The server, given
+      its current time is represented by timestamp T, always interprets
+      timestamps from clients by treating half of the timestamp space as being
+      later in time than T.
+      - http://tronche.com/gui/x/xlib/input/pointer-grabbing.html
+    */
+
+    /* TIME_HALF is half of the number space of a Time type variable */
+#define TIME_HALF (Time)(1 << (sizeof(Time)*8-1))
+
+    if (t2 >= TIME_HALF)
+        /* t2 is in the second half so t1 might wrap around and be smaller than
+           t2 */
+        return t1 >= t2 || t1 < (t2 + TIME_HALF);
+    else
+        /* t2 is in the first half so t1 has to come after it */
+        return t1 >= t2 && t1 < (t2 + TIME_HALF);
+}
This page took 0.020632 seconds and 4 git commands to generate.