changed:
authorStefan Vogel <sv@exept.de>
Mon, 12 Mar 2012 15:43:41 +0100
changeset 5885 a5af5e4ee7c8
parent 5884 32ba594bd33d
child 5886 e72320525e18
changed: #initializeScreenProperties #monitorBounds #queryXVideoExtension Be friendly, if there is no xinerama extension
XWorkstation.st
--- a/XWorkstation.st	Fri Mar 09 09:29:45 2012 +0100
+++ b/XWorkstation.st	Mon Mar 12 15:43:41 2012 +0100
@@ -14,14 +14,15 @@
 DeviceWorkstation subclass:#XWorkstation
 	instanceVariableNames:'hasShapeExtension hasShmExtension hasDPSExtension
 		hasMbufExtension hasXVideoExtension hasSaveUnder hasPEXExtension
-		hasImageExtension hasInputExtension ignoreBackingStore blackpixel
-		whitepixel atoms protocolsAtom deleteWindowAtom saveYourselfAtom
-		quitAppAtom primaryAtom clipboardAtom stringAtom wmStateAtom
-		motifWMHintsAtom listOfXFonts buttonsPressed eventRootX
-		eventRootY displayName eventTrace dispatchingExpose rgbVisual
-		virtualRootId rootId altModifierMask metaModifierMask
-		lastEventTime lastButtonPressTime deviceIOTimeoutErrorSignal
-		activateOnClick rawKeySymTranslation selectionOwner selectionTime
+		hasImageExtension hasInputExtension hasXineramaExtension
+		ignoreBackingStore blackpixel whitepixel atoms protocolsAtom
+		deleteWindowAtom saveYourselfAtom quitAppAtom primaryAtom
+		clipboardAtom stringAtom wmStateAtom motifWMHintsAtom
+		listOfXFonts buttonsPressed eventRootX eventRootY displayName
+		eventTrace dispatchingExpose rgbVisual virtualRootId rootId
+		altModifierMask metaModifierMask lastEventTime
+		lastButtonPressTime deviceIOTimeoutErrorSignal activateOnClick
+		rawKeySymTranslation selectionOwner selectionTime
 		selectionFetchers selectionHandlers preWaitAction xlibTimeout
 		xlibTimeoutForWindowCreation hasConnectionBroken uniqueDeviceID
 		stxDeviceAtom uuidAtom'
@@ -1212,9 +1213,8 @@
     |numberOfMonitors resultArray bounds|
 
 %{
-
 #ifdef XINERAMA
-    if (ISCONNECTED) {
+    if (ISCONNECTED && __INST(hasXineramaExtension) == true) {
         Display *dpy = myDpy;
         XineramaScreenInfo *screenInfo; 
         int numDisplays;
@@ -1223,7 +1223,7 @@
 
         screenInfo = XineramaQueryScreens (dpy, &numDisplays);
         if (screenInfo == 0) {
-            RETURN ( nil );
+            goto out;
         }
 
         numberOfMonitors = __mkSmallInteger(numDisplays);
@@ -1241,7 +1241,12 @@
         XFree(screenInfo);
     }
 #endif
-%}.
+out:;
+%}.
+    numberOfMonitors isNil ifTrue:[
+        "no xinerama - the display is the only monitor"
+        ^ Array with:self bounds.
+    ].
 
     bounds := Array new:numberOfMonitors.
     1 to:numberOfMonitors do:[:idx|
@@ -8100,6 +8105,7 @@
     hasPEXExtension := self queryPEXExtension.
     hasImageExtension := self queryXIEExtension.
     hasInputExtension := self queryXIExtension.
+    hasXineramaExtension := self queryXineramaExtension.
 
     primaryAtom := self atomIDOf:#PRIMARY.
     stringAtom := self atomIDOf:#STRING.
@@ -8647,11 +8653,7 @@
 
         dpy = myDpy;
 
-<<<<<<< XWorkstation.st
-        if (XineramaQueryExtension (dpy, &dummy, &dummy)) {
-=======
         if (XQueryExtension(dpy, "XVideo", &dummy, &dummy, &dummy)) {
->>>>>>> 1.526
             RETURN ( true );
         }
     }
@@ -12256,7 +12258,7 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.528 2012-03-07 14:52:37 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.529 2012-03-12 14:43:41 stefan Exp $'
 !
 
 version_SVN