|
|
af9754 |
From e91197a37f6841ada71204cd41f7d0459adffd9a Mon Sep 17 00:00:00 2001
|
|
|
af9754 |
From: Olivier Fourdan <ofourdan@redhat.com>
|
|
|
af9754 |
Date: Mon, 17 Dec 2018 14:13:05 +0100
|
|
|
af9754 |
Subject: [PATCH] a11y: Check display in `*grab_cell_focus()`
|
|
|
af9754 |
|
|
|
af9754 |
Calling the accessibility function `grab_focus()` on a `GtkCell` under
|
|
|
af9754 |
Wayland will cause the client to crash.
|
|
|
af9754 |
|
|
|
af9754 |
This is another case of `gdk_x11_get_server_time()` being called
|
|
|
af9754 |
regardless of the actual windowing backend used.
|
|
|
af9754 |
|
|
|
af9754 |
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1507
|
|
|
af9754 |
---
|
|
|
af9754 |
gtk/a11y/gtktreeviewaccessible.c | 9 +++++----
|
|
|
af9754 |
1 file changed, 5 insertions(+), 4 deletions(-)
|
|
|
af9754 |
|
|
|
af9754 |
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
|
|
|
af9754 |
index efb9c9bc53..eec4480f29 100644
|
|
|
af9754 |
--- a/gtk/a11y/gtktreeviewaccessible.c
|
|
|
af9754 |
+++ b/gtk/a11y/gtktreeviewaccessible.c
|
|
|
af9754 |
@@ -1174,11 +1174,12 @@ gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent,
|
|
|
af9754 |
if (gtk_widget_is_toplevel (toplevel))
|
|
|
af9754 |
{
|
|
|
af9754 |
#ifdef GDK_WINDOWING_X11
|
|
|
af9754 |
- gtk_window_present_with_time (GTK_WINDOW (toplevel),
|
|
|
af9754 |
- gdk_x11_get_server_time (gtk_widget_get_window (widget)));
|
|
|
af9754 |
-#else
|
|
|
af9754 |
- gtk_window_present (GTK_WINDOW (toplevel));
|
|
|
af9754 |
+ if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (toplevel)))
|
|
|
af9754 |
+ gtk_window_present_with_time (GTK_WINDOW (toplevel),
|
|
|
af9754 |
+ gdk_x11_get_server_time (gtk_widget_get_window (widget)));
|
|
|
af9754 |
+ else
|
|
|
af9754 |
#endif
|
|
|
af9754 |
+ gtk_window_present (GTK_WINDOW (toplevel));
|
|
|
af9754 |
}
|
|
|
af9754 |
|
|
|
af9754 |
return TRUE;
|
|
|
af9754 |
--
|
|
|
af9754 |
2.20.1
|
|
|
af9754 |
|