]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
fix compile without startup notification after r5711
[chaz/openbox] / openbox / event.c
index 15724968844289e85c554903cd48e276c0998ebe..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 */
 }
@@ -1386,5 +1383,15 @@ gboolean event_time_after(Time t1, Time t2)
       later in time than T.
       - http://tronche.com/gui/x/xlib/input/pointer-grabbing.html
     */
-    return t1 >= t2 && t1 <= t2 + (1 << (sizeof(Time)*8-1));
+
+    /* 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.021044 seconds and 4 git commands to generate.