[mutter/gbsneto/cancel-input-actions: 1/4] clutter/click-action: Release when disabling
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/cancel-input-actions: 1/4] clutter/click-action: Release when disabling
- Date: Wed, 8 Apr 2020 18:53:55 +0000 (UTC)
commit 8d2eac8fd28ea5ddbff8d3aaf833d930e764860e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Apr 8 12:36:34 2020 -0300
clutter/click-action: Release when disabling
ClutterClickAction, like other actions, can potentially be disabled
at any time (that is not during painting). When that happens with
ClutterClickAction, it must release all timeouts and disconnect from
the stage's 'capture-event'.
Override ClutterActorMeta.set_enabled and release the click action
when the action is being disabled.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1188
clutter/clutter/clutter-click-action.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/clutter/clutter/clutter-click-action.c b/clutter/clutter/clutter-click-action.c
index cb35d7253..762fb2f9a 100644
--- a/clutter/clutter/clutter-click-action.c
+++ b/clutter/clutter/clutter-click-action.c
@@ -473,6 +473,20 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
CLUTTER_ACTOR_META_CLASS (clutter_click_action_parent_class)->set_actor (meta, actor);
}
+static void
+clutter_click_action_set_enabled (ClutterActorMeta *meta,
+ gboolean is_enabled)
+{
+ ClutterClickAction *click_action = CLUTTER_CLICK_ACTION (meta);
+ ClutterActorMetaClass *parent_class =
+ CLUTTER_ACTOR_META_CLASS (clutter_click_action_parent_class);
+
+ if (!is_enabled)
+ clutter_click_action_release (click_action);
+
+ parent_class->set_enabled (meta, is_enabled);
+}
+
static void
clutter_click_action_set_property (GObject *gobject,
guint prop_id,
@@ -552,6 +566,7 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
ClutterActorMetaClass *meta_class = CLUTTER_ACTOR_META_CLASS (klass);
meta_class->set_actor = clutter_click_action_set_actor;
+ meta_class->set_enabled = clutter_click_action_set_enabled;
gobject_class->dispose = clutter_click_action_dispose;
gobject_class->set_property = clutter_click_action_set_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]