[gtk+] x11: Trap possible X error
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11: Trap possible X error
- Date: Wed, 11 May 2016 01:30:21 +0000 (UTC)
commit 7e7d7991cc8e7c7a2b50ce6530a8ebafd673516b
Author: Matthias Clasen <mclasen redhat com>
Date: Tue May 10 21:29:10 2016 -0400
x11: Trap possible X error
XIGetClientPointer can generate X errors (e.g. when the X server
does not support XI2. Trap them and carry on.
https://bugzilla.gnome.org/show_bug.cgi?id=766233
gdk/x11/gdkdisplay-x11.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index f7c79c4..ad65e29 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -2881,10 +2881,14 @@ gdk_x11_display_get_default_seat (GdkDisplay *display)
{
GList *seats, *l;
int device_id;
+ gboolean result = FALSE;
seats = gdk_display_list_seats (display);
- XIGetClientPointer (GDK_DISPLAY_XDISPLAY (display),
- None, &device_id);
+
+ gdk_x11_display_error_trap_push (display);
+ result = XIGetClientPointer (GDK_DISPLAY_XDISPLAY (display),
+ None, &device_id);
+ gdk_x11_display_error_trap_pop_ignored (display);
for (l = seats; l; l = l->next)
{
@@ -2892,7 +2896,7 @@ gdk_x11_display_get_default_seat (GdkDisplay *display)
pointer = gdk_seat_get_pointer (l->data);
- if (gdk_x11_device_get_id (pointer) == device_id)
+ if (gdk_x11_device_get_id (pointer) == device_id || !result)
{
GdkSeat *seat = l->data;
g_list_free (seats);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]