From 0ed9c6e52483d6aabab971a18032e316f09a358d Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 18 Jun 2021 16:36:25 +0200 Subject: [PATCH] clutter: Drop default action of Pan action By default, the pan action performs matrix translations on the child widget. Nobody wants that (or, nobody wants *just* that). It's cleaner not to mix mechanism and effect in ClutterGestureAction subclasses, so drop this base implementation, and change the signal accumulator so it's more similar to event signals (not that it's used any longer, anyway). Part-of: --- clutter/clutter/clutter-pan-action.c | 24 +----------------------- clutter/clutter/clutter-pan-action.h | 3 --- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/clutter/clutter/clutter-pan-action.c b/clutter/clutter/clutter-pan-action.c index 5ad82ff6f..5521121ce 100644 --- a/clutter/clutter/clutter-pan-action.c +++ b/clutter/clutter/clutter-pan-action.c @@ -348,25 +348,6 @@ gesture_end (ClutterGestureAction *gesture, } } -static gboolean -clutter_pan_action_real_pan (ClutterPanAction *self, - ClutterActor *actor, - gboolean is_interpolated) -{ - gfloat dx, dy; - graphene_matrix_t transform; - graphene_matrix_t translate; - - clutter_pan_action_get_constrained_motion_delta (self, 0, &dx, &dy); - - clutter_actor_get_child_transform (actor, &transform); - graphene_matrix_init_translate (&translate, - &GRAPHENE_POINT3D_INIT (dx, dy, 0.0f)); - graphene_matrix_multiply (&translate, &transform, &transform); - clutter_actor_set_child_transform (actor, &transform); - return TRUE; -} - static void clutter_pan_action_set_property (GObject *gobject, guint prop_id, @@ -483,8 +464,6 @@ clutter_pan_action_class_init (ClutterPanActionClass *klass) ClutterGestureActionClass *gesture_class = CLUTTER_GESTURE_ACTION_CLASS (klass); - klass->pan = clutter_pan_action_real_pan; - gesture_class->gesture_prepare = gesture_prepare; gesture_class->gesture_begin = gesture_begin; gesture_class->gesture_progress = gesture_progress; @@ -586,8 +565,7 @@ clutter_pan_action_class_init (ClutterPanActionClass *klass) g_signal_new (I_("pan"), G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterPanActionClass, pan), - _clutter_boolean_continue_accumulator, NULL, + 0, g_signal_accumulator_true_handled, NULL, _clutter_marshal_BOOLEAN__OBJECT_BOOLEAN, G_TYPE_BOOLEAN, 2, CLUTTER_TYPE_ACTOR, diff --git a/clutter/clutter/clutter-pan-action.h b/clutter/clutter/clutter-pan-action.h index 64115b69b..c74014792 100644 --- a/clutter/clutter/clutter-pan-action.h +++ b/clutter/clutter/clutter-pan-action.h @@ -84,9 +84,6 @@ struct _ClutterPanActionClass ClutterGestureActionClass parent_class; /*< public >*/ - gboolean (* pan) (ClutterPanAction *action, - ClutterActor *actor, - gboolean is_interpolated); void (* pan_stopped) (ClutterPanAction *action, ClutterActor *actor);