Commit 35cd0be4 authored by Timm Bäder's avatar Timm Bäder 👎

Range: Group all three gestures

And reset the grab_location in the ::released handler of the multipress
gesture.

Previously, when leaving fine-tune mode, the ::released handler of the
multipress gesture would call stop_scrolling, which calls
range_grab_remove and resets the grab_location. The ::drag-end handler
is executed after that, and only unsets priv->in_drag if the
grab_location is MOUSE_OUTSIDE, which it never was, since the ::released
handler already reset it. This lead to priv->in_drag being set even
though no dragging was in progress anymore, which e.g. made shift
pressed after leaving the fine-tune mode entering it again.

https://bugzilla.gnome.org/show_bug.cgi?id=761402
parent 7b88e304
......@@ -237,10 +237,6 @@ static void gtk_range_drag_gesture_update (GtkGestureDrag *gesture
gdouble offset_x,
gdouble offset_y,
GtkRange *range);
static void gtk_range_drag_gesture_end (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y,
GtkRange *range);
static void gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
gdouble x,
gdouble y,
......@@ -804,11 +800,10 @@ gtk_range_init (GtkRange *range)
G_CALLBACK (gtk_range_drag_gesture_begin), range);
g_signal_connect (priv->drag_gesture, "drag-update",
G_CALLBACK (gtk_range_drag_gesture_update), range);
g_signal_connect (priv->drag_gesture, "drag-end",
G_CALLBACK (gtk_range_drag_gesture_end), range);
priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (range));
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0);
gtk_gesture_group (priv->drag_gesture, priv->multipress_gesture);
g_signal_connect (priv->multipress_gesture, "pressed",
G_CALLBACK (gtk_range_multipress_gesture_pressed), range);
g_signal_connect (priv->multipress_gesture, "released",
......@@ -2624,6 +2619,7 @@ gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture,
priv->mouse_x = x;
priv->mouse_y = y;
range->priv->in_drag = FALSE;
stop_scrolling (range);
}
......@@ -2955,19 +2951,6 @@ gtk_range_drag_gesture_begin (GtkGestureDrag *gesture,
gtk_gesture_set_state (range->priv->drag_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
}
static void
gtk_range_drag_gesture_end (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y,
GtkRange *range)
{
if (range->priv->grab_location == MOUSE_SLIDER)
{
range->priv->in_drag = FALSE;
stop_scrolling (range);
}
}
static gboolean
gtk_range_event (GtkWidget *widget,
GdkEvent *event)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment