summaryrefslogtreecommitdiff
path: root/gtk/gtkgesture.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2015-09-21 15:00:28 +0200
committerCarlos Garnacho <carlosg@gnome.org>2015-09-21 15:53:28 +0200
commitdefa1e9c0da70b270b63093eb2bc7c11968dab2e (patch)
treef64cdab1e91090b8d92bd77454b41c9841c5c777 /gtk/gtkgesture.c
parente3d21accd090183ba71502e140858f5d7cc500c6 (diff)
downloadgtk+-defa1e9c0da70b270b63093eb2bc7c11968dab2e.tar.gz
gesture: strengthen against destroyed windows
Bail out when we receive an event with an already destroyed window, we'll hopefully get reset/cancelled afterwards on grab broken events. https://bugzilla.gnome.org/show_bug.cgi?id=755352
Diffstat (limited to 'gtk/gtkgesture.c')
-rw-r--r--gtk/gtkgesture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index cb0fbbe80b..ab4f20b5b8 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -400,7 +400,7 @@ _find_widget_window (GtkGesture *gesture,
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
- while (window)
+ while (window && !gdk_window_is_destroyed (window))
{
gdk_window_get_user_data (window, (gpointer*) &window_widget);
@@ -474,6 +474,10 @@ _update_widget_coordinates (GtkGesture *gesture,
gint wx, wy, x, y;
event_widget = gtk_get_event_widget (data->event);
+
+ if (!event_widget)
+ return;
+
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
event_widget_window = gtk_widget_get_window (event_widget);
_get_event_coordinates (data, &event_x, &event_y);