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:
Carlos Garnacho 2020-07-09 20:44:42 +02:00
parent 8c95a84ea4
commit e1a0171094

View File

@ -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",