[mouse] Drop motion events

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-09 19:32:15 +02:00
parent e118f043b5
commit 4151df7136
1 changed files with 14 additions and 7 deletions

15
mouse.c
View File

@ -299,12 +299,16 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
} }
p_delete(&mquery_pointer_r); p_delete(&mquery_pointer_r);
} }
p_delete(&ev);
while((ev = xcb_poll_for_event(globalconf.connection))
&& (ev->response_type & 0x7f) == XCB_MOTION_NOTIFY)
p_delete(&ev);
break; break;
default: default:
xcb_handle_event(globalconf.evenths, ev); xcb_handle_event(globalconf.evenths, ev);
p_delete(&ev);
break; break;
} }
p_delete(&ev);
} }
} }
} }
@ -392,7 +396,7 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
{ {
/* XMaskEvent allows to retrieve only specified events from /* XMaskEvent allows to retrieve only specified events from
* the queue and requeue the other events... */ * the queue and requeue the other events... */
while((ev = xcb_wait_for_event(globalconf.connection))) while(ev || (ev = xcb_wait_for_event(globalconf.connection)))
{ {
switch((ev->response_type & 0x7f)) switch((ev->response_type & 0x7f))
{ {
@ -442,13 +446,16 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
layout_refresh(); layout_refresh();
} }
} }
p_delete(&ev);
while((ev = xcb_poll_for_event(globalconf.connection))
&& (ev->response_type & 0x7f) == XCB_MOTION_NOTIFY)
p_delete(&ev);
break; break;
default: default:
xcb_handle_event(globalconf.evenths, ev); xcb_handle_event(globalconf.evenths, ev);
p_delete(&ev);
break; break;
} }
p_delete(&ev);
} }
} }
} }