[PATCH 2/2] Don't allow both RandR XINERAMA and pseudoramiX XINERAMA extensions to register

Jon TURNEY jon.turney at dronecode.org.uk
Mon Mar 16 10:10:12 PDT 2015


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.

XXX: 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 <jon.turney at dronecode.org.uk>
---
 pseudoramiX/pseudoramiX.c | 4 ++++
 randr/rrxinerama.c        | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/pseudoramiX/pseudoramiX.c b/pseudoramiX/pseudoramiX.c
index d0e2603..e59ca13 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 b336bd7..36632c7 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
-- 
2.1.4



More information about the xorg-devel mailing list