mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
gtk/textview: Clean up further if the drag gesture is taken over
If the gesture becomes captured (e.g. from a parent scrolledwindow), we leave some things in the air. Clean these up properly. This is recurrent with touch scroll.
This commit is contained in:
parent
fa5fa3a881
commit
5e907ebd58
@ -7344,11 +7344,6 @@ gtk_text_view_drag_gesture_end (GtkGestureDrag *gesture,
|
||||
priv = text_view->priv;
|
||||
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
||||
|
||||
if (!drag_gesture_get_text_surface_coords (gesture, text_view,
|
||||
&start_x, &start_y, &x, &y))
|
||||
return;
|
||||
|
||||
|
||||
clicked_in_selection =
|
||||
g_object_get_qdata (G_OBJECT (gesture), quark_text_selection_data) == NULL;
|
||||
g_object_set_qdata (G_OBJECT (gesture), quark_text_selection_data, NULL);
|
||||
@ -7363,6 +7358,10 @@ gtk_text_view_drag_gesture_end (GtkGestureDrag *gesture,
|
||||
if (priv->magnifier_popover)
|
||||
gtk_widget_hide (priv->magnifier_popover);
|
||||
|
||||
if (!drag_gesture_get_text_surface_coords (gesture, text_view,
|
||||
&start_x, &start_y, &x, &y))
|
||||
return;
|
||||
|
||||
/* Check whether the drag was cancelled rather than finished */
|
||||
if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user