[gtk/wip/baedert/for-master: 112/128] textview: Respect return value of get_text_surface_coords()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 112/128] textview: Respect return value of get_text_surface_coords()
- Date: Thu, 22 Oct 2020 15:46:50 +0000 (UTC)
commit af97f199260203997e37494c31beb8ca3ab58063
Author: Timm Bäder <mail baedert org>
Date: Thu Oct 15 06:36:17 2020 +0200
textview: Respect return value of get_text_surface_coords()
gtk/gtktextview.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 1277bfb1b8..6d368ead40 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -7226,8 +7226,10 @@ gtk_text_view_drag_gesture_update (GtkGestureDrag *gesture,
data = g_object_get_qdata (G_OBJECT (gesture), quark_text_selection_data);
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
- drag_gesture_get_text_surface_coords (gesture, text_view,
- &start_x, &start_y, &x, &y);
+
+ if (!drag_gesture_get_text_surface_coords (gesture, text_view,
+ &start_x, &start_y, &x, &y))
+ return;
device = gdk_event_get_device (event);
@@ -7347,8 +7349,11 @@ gtk_text_view_drag_gesture_end (GtkGestureDrag *gesture,
priv = text_view->priv;
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
- drag_gesture_get_text_surface_coords (gesture, text_view,
- &start_x, &start_y, &x, &y);
+
+ 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]