diff --git a/clutter/clutter-event.c b/clutter/clutter-event.c index 48e7aeee2..e963c283c 100644 --- a/clutter/clutter-event.c +++ b/clutter/clutter-event.c @@ -1627,3 +1627,26 @@ clutter_event_has_control_modifier (const ClutterEvent *event) { return (clutter_event_get_state (event) & CLUTTER_CONTROL_MASK) != FALSE; } + +/** + * clutter_event_is_pointer_emulated: + * @event: a #ClutterEvent + * + * Checks whether a pointer @event has been generated by the windowing + * system. The returned value can be used to distinguish between events + * synthesized by the windowing system itself (as opposed by Clutter). + * + * Return value: %TRUE if the event is pointer emulated + * + * Since: 1.12 + */ +gboolean +clutter_event_is_pointer_emulated (const ClutterEvent *event) +{ + g_return_val_if_fail (event != NULL, FALSE); + + if (!is_event_allocated (event)) + return FALSE; + + return ((ClutterEventPrivate *) event)->is_pointer_emulated; +} diff --git a/clutter/clutter-event.h b/clutter/clutter-event.h index 0569b13ab..34566c7bf 100644 --- a/clutter/clutter-event.h +++ b/clutter/clutter-event.h @@ -460,6 +460,8 @@ CLUTTER_AVAILABLE_IN_1_12 gboolean clutter_event_has_shift_modifier (const ClutterEvent *event); CLUTTER_AVAILABLE_IN_1_12 gboolean clutter_event_has_control_modifier (const ClutterEvent *event); +CLUTTER_AVAILABLE_IN_1_12 +gboolean clutter_event_is_pointer_emulated (const ClutterEvent *event); void clutter_event_set_key_symbol (ClutterEvent *event, guint key_sym); diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols index d3a5dd298..22a4b8d60 100644 --- a/clutter/clutter.symbols +++ b/clutter/clutter.symbols @@ -670,6 +670,7 @@ clutter_event_get_time clutter_event_get clutter_event_has_control_modifier clutter_event_has_shift_modifier +clutter_event_is_pointer_emulated clutter_event_new clutter_event_peek clutter_event_put