From 4584e97c01dce60ffebb9a314f9e5f39feed776b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 9 Mar 2016 10:33:50 +0100 Subject: 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: Olivier Fourdan Reviewed-by: Peter Hutterer (cherry picked from commit 88e981e7088198fabea6c322c58f371d91578b6a) --- hw/xwayland/xwayland-input.c | 3 +++ hw/xwayland/xwayland.c | 7 +++++++ hw/xwayland/xwayland.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index e2b1c7d21..609f69199 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -567,6 +567,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 " diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index b4e40f49b..f01ec57fa 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -518,6 +518,13 @@ block_handler(void *data, struct timeval **tv, void *read_mask) 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) { diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index 316500db7..7f4bc5def 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -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); -- cgit v1.2.3