diff options
author | Christian Hergert <christian@hergert.me> | 2015-03-21 14:17:39 -0700 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-03-21 20:05:08 -0400 |
commit | 7bb3d9557f1695d53bdd7fece1421ac8a3faffa7 (patch) | |
tree | 99d9119e7f18933123510615106f6e9c33e83353 /gtk/a11y | |
parent | 9e9c0a133e8e8f56f83f43ac4c159472d5631e70 (diff) | |
download | gtk+-7bb3d9557f1695d53bdd7fece1421ac8a3faffa7.tar.gz |
a11y: handle atk race condition where widget has been destroyed
If the widget has been destroyed since a DBus message had been sent,
we could be in a condition that the widget pointer exists but it does
not have a window.
This bails as if the widget didn't exist if there is no available
GdkWindow.
We also set the extents to 0 to be defensive since this is a vfunc
implementation.
https://bugzilla.gnome.org/show_bug.cgi?id=746586
Diffstat (limited to 'gtk/a11y')
-rw-r--r-- | gtk/a11y/gtktextviewaccessible.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c index d2f17e6edb..f97c155d1d 100644 --- a/gtk/a11y/gtktextviewaccessible.c +++ b/gtk/a11y/gtktextviewaccessible.c @@ -509,6 +509,11 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, GdkWindow *window; gint x_widget, y_widget, x_window, y_window; + *x = 0; + *y = 0; + *width = 0; + *height = 0; + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); if (widget == NULL) return; @@ -519,6 +524,9 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, gtk_text_view_get_iter_location (view, &iter, &rectangle); window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_WIDGET); + if (window == NULL) + return; + gdk_window_get_origin (window, &x_widget, &y_widget); *height = rectangle.height; |