From b31a2ece5c1abede289e45a023bed4d933077aaa Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 3 Nov 2003 20:10:34 +0000 Subject: [PATCH] Introduce a GDK_DEBUG_XINERAMA debug flag, and make it trigger a fake 2x2 Mon Nov 3 20:56:28 2003 Matthias Clasen * gdk/gdk.c: * gdk/gdkinternals.h: * gdk/x11/gdkscreen-x11.c (init_xinerama_support): Introduce a GDK_DEBUG_XINERAMA debug flag, and make it trigger a fake 2x2 Xinerama mode when no actual Xinerama setup is found. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gdk/gdk.c | 1 + gdk/gdkinternals.h | 3 ++- gdk/x11/gdkscreen-x11.c | 39 +++++++++++++++++++++++++++++++++------ 8 files changed, 76 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 298c347562..ddf6188e36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Nov 3 20:56:28 2003 Matthias Clasen + + * gdk/gdk.c: + * gdk/gdkinternals.h: + * gdk/x11/gdkscreen-x11.c (init_xinerama_support): Introduce a + GDK_DEBUG_XINERAMA debug flag, and make it trigger a fake 2x2 + Xinerama mode when no actual Xinerama setup is found. + 2003-11-03 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (shortcuts_select_folder): Removed. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 298c347562..ddf6188e36 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Nov 3 20:56:28 2003 Matthias Clasen + + * gdk/gdk.c: + * gdk/gdkinternals.h: + * gdk/x11/gdkscreen-x11.c (init_xinerama_support): Introduce a + GDK_DEBUG_XINERAMA debug flag, and make it trigger a fake 2x2 + Xinerama mode when no actual Xinerama setup is found. + 2003-11-03 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (shortcuts_select_folder): Removed. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 298c347562..ddf6188e36 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Nov 3 20:56:28 2003 Matthias Clasen + + * gdk/gdk.c: + * gdk/gdkinternals.h: + * gdk/x11/gdkscreen-x11.c (init_xinerama_support): Introduce a + GDK_DEBUG_XINERAMA debug flag, and make it trigger a fake 2x2 + Xinerama mode when no actual Xinerama setup is found. + 2003-11-03 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (shortcuts_select_folder): Removed. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 298c347562..ddf6188e36 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Nov 3 20:56:28 2003 Matthias Clasen + + * gdk/gdk.c: + * gdk/gdkinternals.h: + * gdk/x11/gdkscreen-x11.c (init_xinerama_support): Introduce a + GDK_DEBUG_XINERAMA debug flag, and make it trigger a fake 2x2 + Xinerama mode when no actual Xinerama setup is found. + 2003-11-03 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (shortcuts_select_folder): Removed. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 298c347562..ddf6188e36 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Nov 3 20:56:28 2003 Matthias Clasen + + * gdk/gdk.c: + * gdk/gdkinternals.h: + * gdk/x11/gdkscreen-x11.c (init_xinerama_support): Introduce a + GDK_DEBUG_XINERAMA debug flag, and make it trigger a fake 2x2 + Xinerama mode when no actual Xinerama setup is found. + 2003-11-03 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (shortcuts_select_folder): Removed. diff --git a/gdk/gdk.c b/gdk/gdk.c index 266f594cff..a9f2078f7d 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -69,6 +69,7 @@ static const GDebugKey gdk_debug_keys[] = { {"input", GDK_DEBUG_INPUT}, {"cursor", GDK_DEBUG_CURSOR}, {"multihead", GDK_DEBUG_MULTIHEAD}, + {"xinerama", GDK_DEBUG_XINERAMA} }; static const int gdk_ndebug_keys = G_N_ELEMENTS (gdk_debug_keys); diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index d1e3e857e4..45c6e1c327 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -77,7 +77,8 @@ typedef enum { GDK_DEBUG_IMAGE = 1 << 9, GDK_DEBUG_INPUT = 1 <<10, GDK_DEBUG_CURSOR = 1 <<11, - GDK_DEBUG_MULTIHEAD = 1 <<12 + GDK_DEBUG_MULTIHEAD = 1 <<12, + GDK_DEBUG_XINERAMA = 1 <<13 } GdkDebugFlag; #ifndef GDK_DISABLE_DEPRECATED diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index db14fb5d48..f43f299765 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -537,12 +537,39 @@ init_xinerama_support (GdkScreen * screen) /* No Xinerama */ - screen_x11->num_monitors = 1; - screen_x11->monitors = g_new0 (GdkRectangle, 1); - screen_x11->monitors[0].x = 0; - screen_x11->monitors[0].y = 0; - screen_x11->monitors[0].width = WidthOfScreen (screen_x11->xscreen); - screen_x11->monitors[0].height = HeightOfScreen (screen_x11->xscreen); +#ifdef G_ENABLE_DEBUG + if (_gdk_debug_flags & GDK_DEBUG_XINERAMA) + { + /* Fake Xinerama mode by splitting the screen into 4 monitors */ + screen_x11->num_monitors = 4; + screen_x11->monitors = g_new0 (GdkRectangle, 4); + screen_x11->monitors[0].x = 0; + screen_x11->monitors[0].y = 0; + screen_x11->monitors[0].width = WidthOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[0].height = HeightOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[1].x = WidthOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[1].y = 0; + screen_x11->monitors[1].width = WidthOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[1].height = HeightOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[2].x = 0; + screen_x11->monitors[2].y = HeightOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[2].width = WidthOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[2].height = HeightOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[3].x = WidthOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[3].y = HeightOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[3].width = WidthOfScreen (screen_x11->xscreen) / 2; + screen_x11->monitors[3].height = HeightOfScreen (screen_x11->xscreen) / 2; + } + else +#endif + { + screen_x11->num_monitors = 1; + screen_x11->monitors = g_new0 (GdkRectangle, 1); + screen_x11->monitors[0].x = 0; + screen_x11->monitors[0].y = 0; + screen_x11->monitors[0].width = WidthOfScreen (screen_x11->xscreen); + screen_x11->monitors[0].height = HeightOfScreen (screen_x11->xscreen); + } } static void