summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes <andre@endlessm.com>2020-04-02 16:12:43 +0000
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-04-02 17:09:24 +0000
commit95c1baf3d18fe8e50de402b7af4c29d9ae993d19 (patch)
treea50cbb43330adab67ea95cfcdb53d0d3381e6a14
parent6f9b5edd4deeb412e644122ce2f15b3d593bd07a (diff)
downloadmutter-95c1baf3d18fe8e50de402b7af4c29d9ae993d19.tar.gz
clutter/click-action: Do not process captured event if action is disabled
Disabling a click action after a button-press but before a button-release is captured makes ClutterClickAction connect to captured-event and never disconnect. This change fixes it by making sure the captured-event is only processed if the action is still enabled, otherwise releasing the action (reset state) and propagating the event. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1170 (cherry picked from commit 5f5ce08ba4f6320f27e53440a0ee8d9799e05cf6)
-rw-r--r--clutter/clutter/clutter-click-action.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clutter/clutter/clutter-click-action.c b/clutter/clutter/clutter-click-action.c
index 6b523b033..cb35d7253 100644
--- a/clutter/clutter/clutter-click-action.c
+++ b/clutter/clutter/clutter-click-action.c
@@ -346,6 +346,12 @@ on_captured_event (ClutterActor *stage,
ClutterModifierType modifier_state;
gboolean has_button = TRUE;
+ if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
+ {
+ clutter_click_action_release (action);
+ return CLUTTER_EVENT_PROPAGATE;
+ }
+
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
switch (clutter_event_type (event))