Commit 88e981e7 authored by Olivier Fourdan's avatar Olivier Fourdan

xwayland: sync event queue to check compositor reply

Read and dispatch pending Wayland events to make sure we do not miss a
possible reply from the compositor prior to discard a key repeat.
Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 26ad25a0
......@@ -560,6 +560,9 @@ keyboard_check_repeat (DeviceIntPtr dev, XkbSrvInfoPtr xkbi, unsigned key)
struct wl_callback *callback;
struct sync_pending *p;
/* Make sure we didn't miss a possible reply from the compositor */
xwl_sync_events (xwl_screen);
xorg_list_for_each_entry(p, &xwl_seat->sync_pending, l) {
if (p->pending_dev == dev) {
ErrorF("Key repeat discarded, Wayland compositor doesn't "
......
......@@ -519,6 +519,13 @@ block_handler(void *data, OSTimePtr pTimeout, void *pRead)
xwl_dispatch_events (xwl_screen);
}
void
xwl_sync_events (struct xwl_screen *xwl_screen)
{
xwl_dispatch_events (xwl_screen);
xwl_read_events (xwl_screen);
}
static CARD32
add_client_fd(OsTimerPtr timer, CARD32 time, void *arg)
{
......
......@@ -155,6 +155,8 @@ struct xwl_output {
struct xwl_pixmap;
void xwl_sync_events (struct xwl_screen *xwl_screen);
Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
struct xwl_screen *xwl_screen_get(ScreenPtr screen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment