From 0f40541bb2c95caf8e9f0d6f6694db1dbc0bc4c5 Mon Sep 17 00:00:00 2001 From: Andrea Azzarone Date: Mon, 25 Jun 2018 15:21:16 +0000 Subject: [PATCH] clutter/enum: Add CLUTTER_EVENT_FLAG_REPEATED for auto-repeated events --- clutter/clutter/clutter-enums.h | 4 +++- clutter/clutter/evdev/clutter-input-device-evdev.c | 3 +-- clutter/clutter/evdev/clutter-seat-evdev.c | 2 +- src/wayland/meta-wayland-keyboard.c | 7 +++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h index b9987d875..ad038cc93 100644 --- a/clutter/clutter/clutter-enums.h +++ b/clutter/clutter/clutter-enums.h @@ -761,6 +761,7 @@ typedef enum { /*< prefix=CLUTTER_DRAG >*/ * ClutterEventFlags: * @CLUTTER_EVENT_NONE: No flag set * @CLUTTER_EVENT_FLAG_SYNTHETIC: Synthetic event + * @CLUTTER_EVENT_FLAG_REPEATED: Auto-repeated event * * Flags for the #ClutterEvent * @@ -769,7 +770,8 @@ typedef enum { /*< prefix=CLUTTER_DRAG >*/ typedef enum { /*< flags prefix=CLUTTER_EVENT >*/ CLUTTER_EVENT_NONE = 0, CLUTTER_EVENT_FLAG_SYNTHETIC = 1 << 0, - CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1 + CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1, + CLUTTER_EVENT_FLAG_REPEATED = 1 << 2 } ClutterEventFlags; /** diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.c b/clutter/clutter/evdev/clutter-input-device-evdev.c index 51c7e942c..1f45afded 100644 --- a/clutter/clutter/evdev/clutter-input-device-evdev.c +++ b/clutter/clutter/evdev/clutter-input-device-evdev.c @@ -313,8 +313,7 @@ start_slow_keys (ClutterEvent *event, SlowKeysEventPending *slow_keys_event; ClutterKeyEvent *key_event = (ClutterKeyEvent *) event; - /* Synthetic key events are for autorepeat, ignore those... */ - if (key_event->flags & CLUTTER_EVENT_FLAG_SYNTHETIC) + if (key_event->flags & CLUTTER_EVENT_FLAG_REPEATED) return; slow_keys_event = g_new0 (SlowKeysEventPending, 1); diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/clutter/clutter/evdev/clutter-seat-evdev.c index 9bfb75af3..adaf7b28e 100644 --- a/clutter/clutter/evdev/clutter-seat-evdev.c +++ b/clutter/clutter/evdev/clutter-seat-evdev.c @@ -310,7 +310,7 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat, else { changed_state = 0; - clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_SYNTHETIC); + clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_REPEATED); } queue_event (event); diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 2a8cabbc9..3322abc0c 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -647,10 +647,9 @@ default_grab_key (MetaWaylandKeyboardGrab *grab, MetaBackend *backend = meta_get_backend (); #endif - /* Synthetic key events are for autorepeat. Ignore those, as - * autorepeat in Wayland is done on the client side. */ - if ((event->key.flags & CLUTTER_EVENT_FLAG_SYNTHETIC) && - !(event->key.flags & CLUTTER_EVENT_FLAG_INPUT_METHOD)) + /* Ignore autorepeat events, as autorepeat in Wayland is done on the client + * side. */ + if (event->key.flags & CLUTTER_EVENT_FLAG_REPEATED) return FALSE; #ifdef HAVE_NATIVE_BACKEND