From 95e83ff87ab0149ab01c9299524dfbe37d9b21a2 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 12 Jul 2012 02:00:43 +0100 Subject: [PATCH] Don't allow both RandR XINERAMA and pseudoramiX XINERAMA extensions to register Prevent RRXinerama from activating if PseudoramiX is, so we don't get XINERAMA listed twice in the list of extensions. I think this is otherwise benign, as the PseudoramiX XINERAMA gets registered first and thus handles all requests. Perhaps AddExtension() ought to warn us if the extension name is already registered? This appears to be a long-standing bug seen in XQuartz, and now in XWin as well. Future work: Perhaps since RRXinerama isn't actually doing anything useful but faking it when we have one screen, it seems that the PseudoramiX code could be also used in that case. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- pseudoramiX/pseudoramiX.c | 4 ++++ randr/rrxinerama.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pseudoramiX/pseudoramiX.c b/pseudoramiX/pseudoramiX.c index d0e2603b9..e59ca1312 100644 --- a/pseudoramiX/pseudoramiX.c +++ b/pseudoramiX/pseudoramiX.c @@ -49,6 +49,7 @@ #define DEBUG_LOG PseudoramiXDebug Bool noPseudoramiXExtension = FALSE; +extern Bool noRRXineramaExtension; extern int ProcPanoramiXQueryVersion(ClientPtr client); @@ -190,6 +191,9 @@ PseudoramiXExtensionInit(void) } } + /* Do not allow RRXinerama to initialize if we did */ + noRRXineramaExtension = success; + if (!success) { ErrorF("%s Extension (PseudoramiX) failed to initialize\n", PANORAMIX_PROTOCOL_NAME); diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index b336bd7cd..36632c7c7 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -84,6 +84,8 @@ static int ProcRRXineramaIsActive(ClientPtr client); static int ProcRRXineramaQueryScreens(ClientPtr client); static int SProcRRXineramaDispatch(ClientPtr client); +Bool noRRXineramaExtension = FALSE; + /* Proc */ int @@ -488,6 +490,9 @@ RRXineramaExtensionInit(void) return; #endif + if (noRRXineramaExtension) + return; + /* * Xinerama isn't capable enough to have multiple protocol screens each * with their own output geometry. So if there's more than one protocol