diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-09-29 15:29:24 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-09-29 15:30:23 +0200 |
commit | fb9342952eb91e7542f2d279061013cfbb990645 (patch) | |
tree | 3b9ccc524f1d77dda3ba45aa00132338a488933a | |
parent | 7d998ad9fc7ff5d664b693018227730c3f4b8d2a (diff) |
trap BadWindow (and similar) X errors when calling XGetWindowProperty() (LP: #834403)
-rw-r--r-- | src/canberra-gtk-module.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/canberra-gtk-module.c b/src/canberra-gtk-module.c index 63f9465..e777121 100644 --- a/src/canberra-gtk-module.c +++ b/src/canberra-gtk-module.c @@ -370,6 +370,8 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) { xembed = gdk_x11_get_xatom_by_name_for_display(d, "_XEMBED_INFO"); + /* be robust against not existing XIDs (LP: #834403) */ + gdk_error_trap_push(); if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w), xembed, 0, 2, False, xembed, &type_return, @@ -377,6 +379,7 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) { &data) != Success) { return FALSE; } + gdk_error_trap_pop_ignored(); if (type_return == xembed && format_return == 32 && data) ret = TRUE; |