1
0
Fork 0

clutter/swipe-action: Remove deprecated swept signal/vfunc

Also update the test to use swipe signal instead. Nothing seems to
use the signal from GNOME Shell side though

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3379>
This commit is contained in:
Bilal Elmoussaoui 2023-11-09 16:28:56 +01:00 committed by Marge Bot
parent d311ff4a67
commit 81c75b3157
3 changed files with 5 additions and 36 deletions

View file

@ -54,7 +54,6 @@ struct _ClutterSwipeActionPrivate
enum
{
SWEPT,
SWIPE,
LAST_SIGNAL
@ -139,7 +138,6 @@ gesture_end (ClutterGestureAction *action,
gfloat press_x, press_y;
gfloat release_x, release_y;
ClutterSwipeDirection direction = 0;
gboolean can_emit_swipe;
const ClutterEvent *last_event;
clutter_gesture_action_get_press_coords (action,
@ -162,11 +160,7 @@ gesture_end (ClutterGestureAction *action,
else if (press_y - release_y > priv->distance_y)
direction |= CLUTTER_SWIPE_DIRECTION_UP;
/* XXX:2.0 remove */
g_signal_emit (action, swipe_signals[SWIPE], 0, actor, direction,
&can_emit_swipe);
if (can_emit_swipe)
g_signal_emit (action, swipe_signals[SWEPT], 0, actor, direction);
g_signal_emit (action, swipe_signals[SWIPE], 0, actor, direction);
}
static void
@ -190,29 +184,6 @@ clutter_swipe_action_class_init (ClutterSwipeActionClass *klass)
gesture_class->gesture_progress = gesture_progress;
gesture_class->gesture_end = gesture_end;
/**
* ClutterSwipeAction::swept:
* @action: the #ClutterSwipeAction that emitted the signal
* @actor: the #ClutterActor attached to the @action
* @direction: the main direction of the swipe gesture
*
* The signal is emitted when a swipe gesture is recognized on the
* attached actor.
*
* Deprecated: 1.14: Use the [signal@SwipeAction::swipe] signal instead.
*/
swipe_signals[SWEPT] =
g_signal_new (I_("swept"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST |
G_SIGNAL_DEPRECATED,
G_STRUCT_OFFSET (ClutterSwipeActionClass, swept),
NULL, NULL,
_clutter_marshal_VOID__OBJECT_FLAGS,
G_TYPE_NONE, 2,
CLUTTER_TYPE_ACTOR,
CLUTTER_TYPE_SWIPE_DIRECTION);
/**
* ClutterSwipeAction::swipe:
* @action: the #ClutterSwipeAction that emitted the signal

View file

@ -57,8 +57,6 @@ struct _ClutterSwipeAction
/**
* ClutterSwipeActionClass:
* @swept: class handler for the #ClutterSwipeAction::swept signal;
* deprecated since 1.14
* @swipe: class handler for the #ClutterSwipeAction::swipe signal
*
* The #ClutterSwipeActionClass structure contains
@ -70,7 +68,7 @@ struct _ClutterSwipeActionClass
ClutterGestureActionClass parent_class;
/*< public >*/
void (* swept) (ClutterSwipeAction *action,
void (* swipe) (ClutterSwipeAction *action,
ClutterActor *actor,
ClutterSwipeDirection direction);
};

View file

@ -17,7 +17,7 @@ const char *
test_swipe_action_describe (void);
static void
swept_cb (ClutterSwipeAction *action,
swipe_cb (ClutterSwipeAction *action,
ClutterActor *actor,
ClutterSwipeDirection direction,
gpointer data_)
@ -75,7 +75,7 @@ swept_cb (ClutterSwipeAction *action,
g_free (old_str);
}
g_print ("swept: '%s': %s\n", clutter_actor_get_name (actor), direction_str);
g_print ("swipe: '%s': %s\n", clutter_actor_get_name (actor), direction_str);
g_free (direction_str);
}
@ -95,7 +95,7 @@ attach_action (ClutterActor *actor, guint axis)
action = g_object_new (CLUTTER_TYPE_SWIPE_ACTION, NULL);
clutter_actor_add_action (actor, action);
g_signal_connect (action, "swept", G_CALLBACK (swept_cb), GUINT_TO_POINTER (axis));
g_signal_connect (action, "swipe", G_CALLBACK (swipe_cb), GUINT_TO_POINTER (axis));
g_signal_connect (action, "gesture-cancel", G_CALLBACK (gesture_cancel_cb), NULL);
}