From 8b20a27e0a79fbca0d7ab32bf3ff4287b8fbb3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Tue, 3 Apr 2007 13:48:26 +0000 Subject: [PATCH] Revert to non-xinerama mode when XineramaQueryScreens returns NULL; patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2007-04-03 Loïc Minier * gdk/x11/gdkscreen-x11.c: (check_xfree_xinerama): Revert to non-xinerama mode when XineramaQueryScreens returns NULL; patch from Simon McVittie; #425786. svn path=/trunk/; revision=17579 --- ChangeLog | 6 ++++++ gdk/x11/gdkscreen-x11.c | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index be92a82852..559a7c0a8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-03 Loïc Minier + + * gdk/x11/gdkscreen-x11.c: (check_xfree_xinerama): Revert to + non-xinerama mode when XineramaQueryScreens returns NULL; patch from + Simon McVittie; #425786. + 2007-04-02 Michael Natterer * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): remove diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index eb37af1393..f5e08d87ae 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -600,12 +600,16 @@ check_xfree_xinerama (GdkScreen *screen) GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen); XineramaScreenInfo *monitors = XineramaQueryScreens (GDK_SCREEN_XDISPLAY (screen), &screen_x11->num_monitors); - if (screen_x11->num_monitors <= 0) + if (screen_x11->num_monitors <= 0 || monitors == NULL) { - /* FIXME: We need to trap errors, since XINERAMA isn't always XINERAMA. - * I don't think the num_monitors <= 0 check has any validity. - */ - g_error ("error while retrieving Xinerama information"); + /* If Xinerama doesn't think we have any monitors, try acting as + * though we had no Xinerama. If the "no monitors" condition + * is because XRandR 1.2 is currently switching between CRTCs, + * we'll be notified again when we have our monitor back, + * and can go back into Xinerama-ish mode at that point. */ + if (monitors) + XFree (monitors); + return FALSE; } else {