From 5225683d9b6f7a291214749391b4a28c9e51d27a Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 12 Aug 2010 14:37:39 +0200 Subject: [PATCH] Track the last timestamp received from the server Signed-off-by: Uli Schlachter --- event.c | 10 ++++++++++ globalconf.h | 2 ++ property.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/event.c b/event.c index f9d78c2a3..8527ec5a5 100644 --- a/event.c +++ b/event.c @@ -139,6 +139,8 @@ event_handle_button(xcb_button_press_event_t *ev) client_t *c; wibox_t *wibox; + globalconf.timestamp = ev->time; + if(event_handle_mousegrabber(ev->root_x, ev->root_y, 1 << (ev->detail - 1 + 8))) return; @@ -400,6 +402,8 @@ event_handle_motionnotify(xcb_motion_notify_event_t *ev) { wibox_t *wibox; + globalconf.timestamp = ev->time; + if(event_handle_mousegrabber(ev->root_x, ev->root_y, ev->state)) return; @@ -423,6 +427,8 @@ event_handle_leavenotify(xcb_leave_notify_event_t *ev) wibox_t *wibox; client_t *c; + globalconf.timestamp = ev->time; + if(ev->mode != XCB_NOTIFY_MODE_NORMAL) return; @@ -471,6 +477,8 @@ event_handle_enternotify(xcb_enter_notify_event_t *ev) client_t *c; wibox_t *wibox; + globalconf.timestamp = ev->time; + if(ev->mode != XCB_NOTIFY_MODE_NORMAL) return; @@ -555,6 +563,8 @@ event_handle_expose(xcb_expose_event_t *ev) static void event_handle_key(xcb_key_press_event_t *ev) { + globalconf.timestamp = ev->time; + if(globalconf.keygrabber != LUA_REFNIL) { lua_rawgeti(globalconf.L, LUA_REGISTRYINDEX, globalconf.keygrabber); diff --git a/globalconf.h b/globalconf.h index f7cc803d8..a1575c5cb 100644 --- a/globalconf.h +++ b/globalconf.h @@ -131,6 +131,8 @@ typedef struct wibox_array_t wiboxes; /** The startup notification display struct */ SnDisplay *sndisplay; + /** Latest timestamp we got from the X server */ + xcb_timestamp_t timestamp; } awesome_t; extern awesome_t globalconf; diff --git a/property.c b/property.c index 9614165c2..d5090c633 100644 --- a/property.c +++ b/property.c @@ -418,6 +418,8 @@ property_handle_propertynotify(xcb_property_notify_event_t *ev) xcb_atom_t name, xcb_get_property_reply_t *reply) = NULL; + globalconf.timestamp = ev->time; + /* Find the correct event handler */ #define HANDLE(atom_, cb, len) \ if (ev->atom == atom_) \