From 6239e6db182d066f0ebdd18a3624b67dd40a405e Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Mon, 11 Jan 2021 14:29:08 -0300 Subject: [PATCH] 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: --- clutter/clutter/clutter-click-action.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clutter/clutter/clutter-click-action.c b/clutter/clutter/clutter-click-action.c index 63ad203d1..bd94d9105 100644 --- a/clutter/clutter/clutter-click-action.c +++ b/clutter/clutter/clutter-click-action.c @@ -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: