summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2016-03-09 10:33:50 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2016-06-03 09:44:09 +0200
commit88e981e7088198fabea6c322c58f371d91578b6a (patch)
tree6041597d1a5607cd89b0b4434f50d22766788612
parent26ad25a0ed1d99f3cacb711793c830cb5249580e (diff)
xwayland: sync event queue to check compositor replyfor-whot
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 <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/xwayland/xwayland-input.c3
-rw-r--r--hw/xwayland/xwayland.c7
-rw-r--r--hw/xwayland/xwayland.h2
3 files changed, 12 insertions, 0 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 20dd92b7f..16e715567 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -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 "
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index fdc377809..8c49b0b18 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -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)
{
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 5c053d912..70a0492b2 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);