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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-10-06 21:14:10 +02:00
parent 82ef539513
commit 3bfcf4594e
1 changed files with 9 additions and 0 deletions

View File

@ -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);
}