forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
3ba3e8286f
commit
a254a4529f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user