Browse Source

Track the last timestamp received from the server

Signed-off-by: Uli Schlachter <psychon@znc.in>
Uli Schlachter 9 years ago
parent
commit
ec63afc822
3 changed files with 14 additions and 0 deletions
  1. 10
    0
      event.c
  2. 2
    0
      globalconf.h
  3. 2
    0
      property.c

+ 10
- 0
event.c View File

@@ -138,6 +138,8 @@ event_handle_button(xcb_button_press_event_t *ev)
138 138
     client_t *c;
139 139
     wibox_t *wibox;
140 140
 
141
+    globalconf.timestamp = ev->time;
142
+
141 143
     if(event_handle_mousegrabber(ev->root_x, ev->root_y, 1 << (ev->detail - 1 + 8)))
142 144
         return;
143 145
 
@@ -387,6 +389,8 @@ event_handle_motionnotify(xcb_motion_notify_event_t *ev)
387 389
 {
388 390
     wibox_t *wibox;
389 391
 
392
+    globalconf.timestamp = ev->time;
393
+
390 394
     if(event_handle_mousegrabber(ev->root_x, ev->root_y, ev->state))
391 395
         return;
392 396
 
@@ -410,6 +414,8 @@ event_handle_leavenotify(xcb_leave_notify_event_t *ev)
410 414
     wibox_t *wibox;
411 415
     client_t *c;
412 416
 
417
+    globalconf.timestamp = ev->time;
418
+
413 419
     if(ev->mode != XCB_NOTIFY_MODE_NORMAL)
414 420
         return;
415 421
 
@@ -453,6 +459,8 @@ event_handle_enternotify(xcb_enter_notify_event_t *ev)
453 459
     client_t *c;
454 460
     wibox_t *wibox;
455 461
 
462
+    globalconf.timestamp = ev->time;
463
+
456 464
     if(ev->mode != XCB_NOTIFY_MODE_NORMAL)
457 465
         return;
458 466
 
@@ -532,6 +540,8 @@ event_handle_expose(xcb_expose_event_t *ev)
532 540
 static void
533 541
 event_handle_key(xcb_key_press_event_t *ev)
534 542
 {
543
+    globalconf.timestamp = ev->time;
544
+
535 545
     if(globalconf.keygrabber != LUA_REFNIL)
536 546
     {
537 547
         lua_rawgeti(globalconf.L, LUA_REGISTRYINDEX, globalconf.keygrabber);

+ 2
- 0
globalconf.h View File

@@ -96,6 +96,8 @@ typedef struct
96 96
     wibox_array_t wiboxes;
97 97
     /** The startup notification display struct */
98 98
     SnDisplay *sndisplay;
99
+    /** Latest timestamp we got from the X server */
100
+    xcb_timestamp_t timestamp;
99 101
 } awesome_t;
100 102
 
101 103
 extern awesome_t globalconf;

+ 2
- 0
property.c View File

@@ -384,6 +384,8 @@ property_handle_propertynotify(xcb_property_notify_event_t *ev)
384 384
     int (*handler)(uint8_t state,
385 385
                    xcb_window_t window) = NULL;
386 386
 
387
+    globalconf.timestamp = ev->time;
388
+
387 389
     /* Find the correct event handler */
388 390
 #define HANDLE(atom_, cb) \
389 391
     if (ev->atom == atom_) \

Loading…
Cancel
Save