[gtk+] x11: Don't crash if a window is on an unmanaged screen
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11: Don't crash if a window is on an unmanaged screen
- Date: Mon, 25 Nov 2013 20:14:50 +0000 (UTC)
commit 1d2a070254a2f01de3202392a8fdb43fc2ee84d2
Author: Benjamin Otte <otte redhat com>
Date: Mon Nov 25 21:11:56 2013 +0100
x11: Don't crash if a window is on an unmanaged screen
_gdk_x11_display_screen_for_xrootwin() can return NULL. If so, return
NULL from gdk_x11_window_foreign_new_for_display().
https://bugzilla.gnome.org/show_bug.cgi?id=709716
gdk/x11/gdkwindow-x11.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 6ee7a96..a8e92b6 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1229,6 +1229,8 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
XFree (children);
screen = _gdk_x11_display_screen_for_xrootwin (display, root);
+ if (screen == NULL)
+ return NULL;
win = _gdk_display_create_window (display);
win->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]