[gtk+/gtk-3-16] a11y: handle atk race condition where widget has been destroyed
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-16] a11y: handle atk race condition where widget has been destroyed
- Date: Mon, 23 Mar 2015 03:14:06 +0000 (UTC)
commit 0230fff141281c08342eada154819ba7f8b3ab34
Author: Christian Hergert <christian hergert me>
Date: Sat Mar 21 14:17:39 2015 -0700
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
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 d2f17e6..f97c155 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]