Track the last timestamp received from the server
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
47caab4580
commit
ec63afc822
10
event.c
10
event.c
|
@ -138,6 +138,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;
|
||||
|
||||
|
@ -387,6 +389,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;
|
||||
|
||||
|
@ -410,6 +414,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;
|
||||
|
||||
|
@ -453,6 +459,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;
|
||||
|
||||
|
@ -532,6 +540,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);
|
||||
|
|
|
@ -96,6 +96,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;
|
||||
|
|
|
@ -384,6 +384,8 @@ property_handle_propertynotify(xcb_property_notify_event_t *ev)
|
|||
int (*handler)(uint8_t state,
|
||||
xcb_window_t window) = NULL;
|
||||
|
||||
globalconf.timestamp = ev->time;
|
||||
|
||||
/* Find the correct event handler */
|
||||
#define HANDLE(atom_, cb) \
|
||||
if (ev->atom == atom_) \
|
||||
|
|
Loading…
Reference in New Issue