From a254a4529fbb5b2e735fa4bccaaf1cb27faf2c00 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 2 Feb 2023 11:15:24 +0100 Subject: [PATCH] gtkscrolledwindow: Clean up input handling a bit These pieces were added in commit 8d2f81cca4, but are no longer necessary since there's no capture_button_press special behavior toggle. This can be simplified again. --- gtk/gtkscrolledwindow.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index b47eb33a89..0f2612c588 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -273,7 +273,6 @@ typedef struct double drag_start_y; guint kinetic_scrolling : 1; - guint in_drag : 1; guint deceleration_id; @@ -906,7 +905,6 @@ scrolled_window_drag_begin_cb (GtkScrolledWindow *scrolled_window, GdkEventSequence *sequence; GtkWidget *event_widget; - priv->in_drag = FALSE; priv->drag_start_x = priv->unclamped_hadj_value; priv->drag_start_y = priv->unclamped_vadj_value; gtk_scrolled_window_cancel_deceleration (scrolled_window); @@ -977,17 +975,6 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window, gtk_scrolled_window_invalidate_overshoot (scrolled_window); } -static void -scrolled_window_drag_end_cb (GtkScrolledWindow *scrolled_window, - GdkEventSequence *sequence, - GtkGesture *gesture) -{ - GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window); - - if (!priv->in_drag || !gtk_gesture_handles_sequence (gesture, sequence)) - gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_DENIED); -} - static void gtk_scrolled_window_decelerate (GtkScrolledWindow *scrolled_window, double x_velocity, @@ -1040,7 +1027,6 @@ static void scrolled_window_long_press_cancelled_cb (GtkScrolledWindow *scrolled_window, GtkGesture *gesture) { - GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window); GdkEventSequence *sequence; GdkEvent *event; GdkEventType event_type; @@ -1052,9 +1038,6 @@ scrolled_window_long_press_cancelled_cb (GtkScrolledWindow *scrolled_window, if (event_type == GDK_TOUCH_BEGIN || event_type == GDK_BUTTON_PRESS) gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_DENIED); - else if (event_type != GDK_TOUCH_END && - event_type != GDK_BUTTON_RELEASE) - priv->in_drag = TRUE; } static void @@ -2040,9 +2023,6 @@ gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window) g_signal_connect_swapped (priv->drag_gesture, "drag-update", G_CALLBACK (scrolled_window_drag_update_cb), scrolled_window); - g_signal_connect_swapped (priv->drag_gesture, "end", - G_CALLBACK (scrolled_window_drag_end_cb), - scrolled_window); gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (priv->drag_gesture)); priv->pan_gesture = gtk_gesture_pan_new (GTK_ORIENTATION_VERTICAL);