From 3bfcf4594e421943a6662db7609475466083cbc8 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 6 Oct 2010 21:14:10 +0200 Subject: [PATCH] Event handling: Don't reorder mouse handling For performance reasons, we only handle the last motion notify we receive. However, we must make sure that the motion isn't moved after enter or leave notifies. Else, breakage is ensured! Signed-off-by: Uli Schlachter --- awesome.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/awesome.c b/awesome.c index 5695b8a1..c65451ba 100644 --- a/awesome.c +++ b/awesome.c @@ -225,6 +225,15 @@ a_xcb_check_cb(EV_P_ ev_check *w, int revents) } else { + uint8_t type = XCB_EVENT_RESPONSE_TYPE(event); + if((type == XCB_ENTER_NOTIFY || type == XCB_LEAVE_NOTIFY) && mouse) + { + /* Make sure enter/motion/leave events are handled in the + * correct order */ + event_handle(mouse); + p_delete(&mouse); + mouse = NULL; + } event_handle(event); p_delete(&event); }