clutter/click-action: Make sure to never schedule more than one timeout

click_action_query_long_press() can potentially schedule more than
one timeout, since it doesn't clear any already-existing timeout.

Make sure to clear the long press timeout before scheduling a new
one.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1188
This commit is contained in:
Georges Basile Stavracas Neto 2020-04-08 15:48:09 -03:00
parent 633d5d1b84
commit 676997e0af

View File

@ -238,6 +238,7 @@ click_action_query_long_press (ClutterClickAction *action)
if (result) if (result)
{ {
g_clear_handle_id (&priv->long_press_id, g_source_remove);
priv->long_press_id = priv->long_press_id =
clutter_threads_add_timeout (timeout, clutter_threads_add_timeout (timeout,
click_action_emit_long_press, click_action_emit_long_press,