clutter/click-action: Only emit "clicked" when within drag threshold

ClutterClickEvent currently doesn't check if button press and release
happen within the drag threshold, which can be surprising sometimes.

Only emit the "clicked" signal if the button press and release happen
within the area of drag threshold.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1667>
This commit is contained in:
Georges Basile Stavracas Neto 2021-01-11 14:29:08 -03:00 committed by Marge Bot
parent 8a82abc4d7
commit 6239e6db18

View File

@ -419,7 +419,9 @@ on_captured_event (ClutterActor *stage,
priv->modifier_state = 0;
click_action_set_pressed (action, FALSE);
g_signal_emit (action, click_signals[CLICKED], 0, actor);
if (event_within_drag_threshold (action, event))
g_signal_emit (action, click_signals[CLICKED], 0, actor);
break;
case CLUTTER_MOTION: