clutter/enum: Add CLUTTER_EVENT_FLAG_REPEATED for auto-repeated events

This commit is contained in:
Andrea Azzarone 2018-06-25 15:21:16 +00:00 committed by Jonas Ådahl
parent db604dda89
commit 0f40541bb2
4 changed files with 8 additions and 8 deletions

View File

@ -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;
/**

View File

@ -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);

View File

@ -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);

View File

@ -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