mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 15:14:17 +00:00
gtkrange: group gestures the right way around
The gtk_gesture_group() call is not a commutative operation, it takes two gestures, maybe detaches the first one from its current group, and adds it to the same group than the second gesture. With the flipped argument order here, GtkRange was actually detaching the same gesture in order to group it with a second one two times, so the desired effect to group all 3 gestures was not achieved. Fixes autoscroll as the drag gesture is now actually grouped with the click one, so drag offsets can be accessed from the autoscroll timeout.
This commit is contained in:
parent
8c95a84ea4
commit
e1a0171094
@ -567,14 +567,14 @@ gtk_range_init (GtkRange *range)
|
||||
g_signal_connect (gesture, "released",
|
||||
G_CALLBACK (gtk_range_click_gesture_released), range);
|
||||
gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (gesture));
|
||||
gtk_gesture_group (priv->drag_gesture, gesture);
|
||||
gtk_gesture_group (gesture, priv->drag_gesture);
|
||||
|
||||
gesture = gtk_gesture_long_press_new ();
|
||||
gtk_gesture_long_press_set_delay_factor (GTK_GESTURE_LONG_PRESS (gesture), 2.0);
|
||||
g_signal_connect (gesture, "pressed",
|
||||
G_CALLBACK (gtk_range_long_press_gesture_pressed), range);
|
||||
gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (gesture));
|
||||
gtk_gesture_group (priv->drag_gesture, gesture);
|
||||
gtk_gesture_group (gesture, priv->drag_gesture);
|
||||
|
||||
controller = gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);
|
||||
g_signal_connect (controller, "scroll",
|
||||
|
Loading…
Reference in New Issue
Block a user