Fix DISPLAY access for headless servers.
authorStefan Vogel <sv@exept.de>
Tue, 26 Oct 1999 19:52:47 +0200
changeset 394 70ecff920548
parent 393 ae610c970310
child 395 8aaecfe3fbbf
Fix DISPLAY access for headless servers.
display.rc
host.rc
smalltalk.rc
--- a/display.rc	Tue Oct 19 23:32:52 1999 +0200
+++ b/display.rc	Tue Oct 26 19:52:47 1999 +0200
@@ -433,38 +433,40 @@
  * if the image was saved on a different type of display, ask
  * user, if he/she'd like to have the style changed.
  *"
-|depthChange colorChange greyChange reconfigure|
+Display notNil ifTrue:[
+    |depthChange colorChange greyChange reconfigure|
 
-depthChange := false.
-colorChange := false.
-greyChange := false.
+    depthChange := false.
+    colorChange := false.
+    greyChange := false.
 
-(Smalltalk includesKey:#'_ImageDisplayDepth') ifTrue:[
-    depthChange := ((Smalltalk at:#'_ImageDisplayDepth') ~~ Display depth)
-].
-(Smalltalk includesKey:#'_ImageDisplayHasColor') ifTrue:[
-    colorChange := ((Smalltalk at:#'_ImageDisplayHasColors') ~~ Display hasColors)
-].
-(Smalltalk includesKey:#'_ImageDisplayHasGreyscales') ifTrue:[
-    greyChange := ((Smalltalk at:#'_ImageDisplayHasGreyscales') ~~ Display hasGreyscales)
-].
-(depthChange or:[colorChange or:[greyChange]]) ifTrue:[
-    reconfigure := self confirm:'Display capabilities have changed
+    (Smalltalk includesKey:#'_ImageDisplayDepth') ifTrue:[
+	depthChange := ((Smalltalk at:#'_ImageDisplayDepth') ~~ Display depth)
+    ].
+    (Smalltalk includesKey:#'_ImageDisplayHasColor') ifTrue:[
+	colorChange := ((Smalltalk at:#'_ImageDisplayHasColors') ~~ Display hasColors)
+    ].
+    (Smalltalk includesKey:#'_ImageDisplayHasGreyscales') ifTrue:[
+	greyChange := ((Smalltalk at:#'_ImageDisplayHasGreyscales') ~~ Display hasGreyscales)
+    ].
+    (depthChange or:[colorChange or:[greyChange]]) ifTrue:[
+	reconfigure := self confirm:'Display capabilities have changed
 
-Do you want to reconfigure the view style ?'.
+    Do you want to reconfigure the view style ?'.
 
-    reconfigure ifTrue:[
-	Screen current knownViews do:[:aView |
-	    aView notNil ifTrue:[
-		aView reinitStyle.
-	    ]
+	reconfigure ifTrue:[
+	    Screen current knownViews do:[:aView |
+		aView notNil ifTrue:[
+		    aView reinitStyle.
+		]
+	    ].
 	].
     ].
-].
 
-Smalltalk at:#'_ImageDisplayDepth' put:Display depth.
-Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors.
-Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales.
+    Smalltalk at:#'_ImageDisplayDepth' put:Display depth.
+    Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors.
+    Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales.
+]
 !
 
 "/
@@ -525,7 +527,7 @@
     "/ final fallBack ...
 
     View defaultStyle isNil ifTrue:[
-	Display hasGreyscales ifTrue:[
+	(Display notNil and:[Display hasGreyscales]) ifTrue:[
 	    View defaultStyle:#iris
 	] ifFalse:[
 	    View defaultStyle:#normal
--- a/host.rc	Tue Oct 19 23:32:52 1999 +0200
+++ b/host.rc	Tue Oct 26 19:52:47 1999 +0200
@@ -92,30 +92,30 @@
     "/ corresponding setup into a private h_xxxx.rc file.
 
     domain := OperatingSystem getDomainName.
-    (domain = 'exept.de' or:[domain = 'axept.de']) ifTrue:[
+    (domain = 'exept.de') ifTrue:[
 	PostscriptPrinterStream notNil ifTrue:[
 	    isStupidSYSV3 ifTrue:[
-	        PostscriptPrinterStream printCommand:'cat | remsh exept lpr -h'.
-	        PrinterStream printCommand:'cat | remsh exept lpr -h'.
-	        PostscriptPrinterStream defaultCommands:#(
+		PostscriptPrinterStream printCommand:'cat | remsh exept lpr -h'.
+		PrinterStream printCommand:'cat | remsh exept lpr -h'.
+		PostscriptPrinterStream defaultCommands:#(
 					    'cat | remsh exept lpr -h'
 					    'cat > preview.ps'
 					    'cat > preview.ps; ghostview preview.ps'
 				     ).
-	        PrinterStream defaultCommands:#(
+		PrinterStream defaultCommands:#(
 					    'cat | remsh exept lpr -h'
 					    'a2ps | remsh exept lpr -h'
 					    'a2ps > preview.ps; ghostview preview.ps'
 				     ).
 	    ] ifFalse:[
-	        PostscriptPrinterStream printCommand:'cat | rsh exept lpr -h'.
-	        PrinterStream printCommand:'cat | rsh exept lpr -h'.
-	        PostscriptPrinterStream defaultCommands:#(
+		PostscriptPrinterStream printCommand:'cat | rsh exept lpr -h'.
+		PrinterStream printCommand:'cat | rsh exept lpr -h'.
+		PostscriptPrinterStream defaultCommands:#(
 					    'cat | rsh exept lpr -h'
 					    'cat > preview.ps'
 					    'cat > preview.ps; ghostview preview.ps'
 				     ).
-	        PrinterStream defaultCommands:#(
+		PrinterStream defaultCommands:#(
 					    'cat | rsh exept lpr -h'
 					    'a2ps | rsh exept lpr -h'
 					    'a2ps > preview.ps; ghostview preview.ps'
@@ -174,7 +174,7 @@
 "/ for myself: preset flags, so that we can accept GLXWorkstation code
 "/ You probably will never do this.
 "/
-Display supportsGLDrawing ifTrue:[
+(Display notNil and:[Display supportsGLDrawing]) ifTrue:[
     sysType = 'irix' ifTrue:[
 	Compiler stcCompilationDefines:'-DGLX'.
     ] ifFalse:[
--- a/smalltalk.rc	Tue Oct 19 23:32:52 1999 +0200
+++ b/smalltalk.rc	Tue Oct 26 19:52:47 1999 +0200
@@ -87,7 +87,6 @@
     ].
     Smalltalk exit
 ].
-!
 
 "/
 "/ map Language variable setting to known and handled
@@ -96,7 +95,6 @@
 Language == #De ifTrue:[
     Language := #german
 ].
-!
 
 "/
 "/ check for display-classes being compiled into the system;
@@ -104,27 +102,29 @@
 "/ if not, enter a simple read-eval-print loop
 "/
 Display isNil ifTrue:[
-    DeviceWorkstation notNil ifTrue:[
-	'smalltalk.rc [warning]: No Display connection.' errorPrintCR.
-	'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR.
-	'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR.
-	Smalltalk isStandAloneApp ifTrue:[
-	    Smalltalk exit
-	].
+    (args includes:'--noDisplay') ifFalse:[
+	DeviceWorkstation notNil ifTrue:[
+	    'smalltalk.rc [warning]: No Display connection.' errorPrintCR.
+	    'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR.
+	    'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR.
+	    Smalltalk isStandAloneApp ifTrue:[
+		Smalltalk exit
+	    ].
 
-	'' errorPrintCR.
-	'Textmode (enter smalltalk expressions terminated by single exclamation mark;' errorPrintCR.
-	OperatingSystem isUNIXlike ifTrue:[
-	    '          CTRL-D to leave line-by-line interpreter.)' errorPrintCR.
+	    '' errorPrintCR.
+	    'Textmode (enter smalltalk expressions terminated by single exclamation mark;' errorPrintCR.
+	    OperatingSystem isUNIXlike ifTrue:[
+		'          CTRL-D to leave line-by-line interpreter.)' errorPrintCR.
+	    ] ifFalse:[
+		'          CTRL-Z to leave line-by-line interpreter.)' errorPrintCR.
+	    ].
+	    Smalltalk readEvalPrint.
+	    Smalltalk exit
 	] ifFalse:[
-	    '          CTRL-Z to leave line-by-line interpreter.)' errorPrintCR.
+	    Smalltalk isStandAloneApp ifFalse:[
+		'smalltalk.rc [warning]: Configuration without display.' errorPrintCR.
+	    ]
 	].
-	Smalltalk readEvalPrint.
-	Smalltalk exit
-    ] ifFalse:[
-	Smalltalk isStandAloneApp ifFalse:[
-	    'smalltalk.rc [warning]: Configuration without display.' errorPrintCR.
-	]
     ].
 ].
 
@@ -175,7 +175,7 @@
 "/ now always get a chance to make some progress ...
 
 Smalltalk addStartBlock:[
-    'private.rc [info]: start timeSlicing...' infoPrintCR.
+    'smalltalk.rc [info]: start timeSlicing...' infoPrintCR.
     Processor startTimeSlicing.
     Processor supportDynamicPriorities:true.
     ObjectMemory backgroundCollectProcess priorityRange:(4 to:9).