]> Dogcows Code - chaz/openbox/commitdiff
keep event_lasttime at the last time an event has come in so far, don't regress when...
authorDana Jansens <danakj@orodu.net>
Tue, 12 Aug 2003 04:06:30 +0000 (04:06 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 12 Aug 2003 04:06:30 +0000 (04:06 +0000)
openbox/event.c

index a0515e2eebd73e419a32023bdcd73a93479a09a2..b5e15a3c894fdaf6cdf8ec392040e671bdbd98fc 100644 (file)
@@ -223,32 +223,38 @@ static Window event_get_window(XEvent *e)
 
 static void event_set_lasttime(XEvent *e)
 {
+    Time t = 0;
+
     /* grab the lasttime and hack up the state */
     switch (e->type) {
     case ButtonPress:
     case ButtonRelease:
-       event_lasttime = e->xbutton.time;
+       t = e->xbutton.time;
        break;
     case KeyPress:
-       event_lasttime = e->xkey.time;
+       t = e->xkey.time;
        break;
     case KeyRelease:
-       event_lasttime = e->xkey.time;
+       t = e->xkey.time;
        break;
     case MotionNotify:
-       event_lasttime = e->xmotion.time;
+       t = e->xmotion.time;
        break;
     case PropertyNotify:
-       event_lasttime = e->xproperty.time;
+       t = e->xproperty.time;
        break;
     case EnterNotify:
     case LeaveNotify:
-       event_lasttime = e->xcrossing.time;
+       t = e->xcrossing.time;
        break;
     default:
-        event_lasttime = CurrentTime;
+        /* if more event types are anticipated, get their timestamp
+           explicitly */
         break;
     }
+
+    if (t > event_lasttime)
+        event_lasttime = t;
 }
 
 #define STRIP_MODS(s) \
This page took 0.028369 seconds and 4 git commands to generate.