mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2024>
This commit is contained in:
parent
af6fb2a702
commit
0ed9c6e524
@ -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,
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user