fix for non :0 display (i.e. foo:1);
authorClaus Gittinger <cg@exept.de>
Wed, 24 Jul 2002 11:55:39 +0200
changeset 493 bde575727ee7
parent 492 26708ef0fd29
child 494 d03bf348d451
fix for non :0 display (i.e. foo:1); added vnc server detection.
display.rc
--- a/display.rc	Thu Jun 20 16:42:22 2002 +0200
+++ b/display.rc	Wed Jul 24 11:55:39 2002 +0200
@@ -199,18 +199,23 @@
 	"/ figure out the hostname of the display,
 	"/ to read d_<hostname>.rc
 
-	((displayVar startsWith:':0') 
+	((displayVar startsWith:':') 
 	 or:[(displayVar startsWith:'unix:')
 	 or:[displayVar startsWith:'shm:']]) ifTrue:[
 	    "running on a local display"
 	    display := OperatingSystem getHostName.
 	] ifFalse:[
-	    (displayVar endsWith:':0') ifTrue:[
-		display := displayVar copyTo:(displayVar size - 2)
-	    ] ifFalse:[
-		(displayVar endsWith:':0.0') ifTrue:[
-		    display := displayVar copyTo:(displayVar size - 4)
-		]
+	    [(displayVar size > 1) and:[displayVar last isDigit]] whileTrue:[
+		displayVar := displayVar copyWithoutLast:1.
+	    ].
+	    ((displayVar size > 1) and:[displayVar last == $.]) ifTrue:[
+		displayVar := displayVar copyWithoutLast:1.
+		[(displayVar size > 1) and:[displayVar last isDigit]] whileTrue:[
+		    displayVar := displayVar copyWithoutLast:1.
+		].
+	    ].
+	    ((displayVar size > 1) and:[displayVar last == $:]) ifTrue:[
+		display := displayVar copyWithoutLast:1
 	    ]
 	].
     ].
@@ -269,6 +274,10 @@
     ifTrue:[
 	displayType := 'hpux'
     ].
+    (serverVendor startsWith:'AT&T Laboratories Cambridge')
+    ifTrue:[
+	displayType := 'vnc'
+    ].
 ].
 
 displayType isNil ifTrue:[
@@ -329,17 +338,21 @@
 
 displayType isNil ifTrue:[
     "
-     final fallback: use type of machine if smalltalk is running on a local
-     connection.
+     final fallback: use local hosts name, if display is the local one;
+     otherwise, use the type of display
+
      the used name is one of:
-	d_next.rc
-	d_iris.rc
-	etc.
+	d_hostName.rc
+     for local display;
+     or:
+	d_X11.rc
+	d_WIN32.rc
+     for remote display.
     "
-    "use type of machine smalltalk is running on as default ..."
-
     display = OperatingSystem getHostName ifTrue:[
 	displayType := OperatingSystem getSystemType.
+    ] ifFalse:[
+	displayType :=  displayDevice platformName.
     ]
 ].