--- a/DeviceWorkstation.st Wed Feb 26 18:44:22 2020 +0100
+++ b/DeviceWorkstation.st Wed Feb 26 19:30:45 2020 +0100
@@ -412,12 +412,12 @@
newDevice := self newFor:aScreenName.
newDevice startDispatch.
- (someScreen := Screen current) isNil ifTrue:[
- someScreen := Screen default.
+ (someScreen := self current) isNil ifTrue:[
+ someScreen := self default.
].
someScreen notNil ifTrue:[
- newDevice keyboardMap:(someScreen keyboardMap).
- newDevice buttonTranslation:(someScreen buttonTranslation).
+ newDevice keyboardMap:(someScreen keyboardMap).
+ newDevice buttonTranslation:(someScreen buttonTranslation).
].
"/ arrange for it to finish its event dispatch loop,
@@ -441,50 +441,53 @@
|display displayName|
- displayName := aStringOrNil ? Screen defaultDisplayName.
+ displayName := aStringOrNil ? self defaultDisplayName.
"find out about the concrete Workstation class"
Screen isAbstract ifTrue:[
- |wsClass wsClasses|
-
- wsClasses := OrderedCollection new.
-
- #(OpenGLWorkstation GLXWorkstation XWorkstation)
- detect:[:eachClassNameSymbol| (wsClass := Smalltalk classNamed:eachClassNameSymbol) notNil] ifNone:nil.
- wsClass notNil ifTrue:[wsClasses add:wsClass].
-
- "preparation for WIN32/NeXTStep/OS2 and Mac interfacing;
- But if X11 is linked in and it is capable of setting up a connection, that will be used."
- #(
- "/ #NeXTWorkstation nil
- OS2Workstation isOS2like
- MacWorkstation isMAClike
- WinWorkstation isMSWINDOWSlike
- ElectronWorkstation nil
- ) pairWiseDo:[:wsClassName :checkSel|
- (checkSel isNil or:[OperatingSystem perform:checkSel]) ifTrue:[
- (wsClass := Smalltalk classNamed:wsClassName) notNil ifTrue:[
- wsClasses add:wsClass.
- ]
- ].
- ].
-
- "/ try all classes until open of display works.
- wsClasses detect:[:cls|
- [
- display := cls newFor:displayName.
- ] on:Screen deviceOpenErrorSignal do:[:ex| ].
- display notNil
- ] ifNone:nil.
+ |wsClass wsClasses|
+
+ wsClasses := OrderedCollection new.
+
+ wsClass := #(OpenGLWorkstation GLXWorkstation XWorkstation)
+ detect:[:eachClassNameSymbol| (Smalltalk classNamed:eachClassNameSymbol) notNil] ifNone:nil.
+ wsClass notNil ifTrue:[
+ wsClasses add:wsClass
+ ].
+
+ "preparation for WIN32/NeXTStep/OS2 and Mac interfacing;
+ But if X11 is linked in and it is capable of setting up a connection, that will be used."
+ #(
+ "/ NeXTWorkstation nil
+ OS2Workstation isOS2like
+ MacWorkstation isMAClike
+ WinWorkstation isMSWINDOWSlike
+ ElectronWorkstation nil
+ ) pairWiseDo:[:wsClassName :checkSel|
+ ((checkSel isNil or:[OperatingSystem perform:checkSel])
+ and:[(wsClass := Smalltalk classNamed:wsClassName) notNil]) ifTrue:[
+ wsClasses add:wsClass.
+ ].
+ ].
+
+ "/ try all classes until open of display works.
+ wsClasses detect:[:eachWorkstationClass|
+ [
+ display := eachWorkstationClass newFor:displayName.
+ ] on:eachWorkstationClass deviceOpenErrorSignal do:[:ex| ].
+ display notNil
+ ] ifNone:nil.
] ifFalse:[
- display := Screen newFor:displayName.
+ display := Screen newFor:displayName.
].
display isNil ifTrue:[
- Screen deviceOpenErrorSignal raiseWith:displayName.
+ Screen deviceOpenErrorSignal raiseWith:displayName.
].
Screen := display class.
Screen default:display.
+
+ ^ display.
! !
!DeviceWorkstation class methodsFor:'Signal constants'!
@@ -1679,20 +1682,20 @@
id := self viewIdFromPoint:aScreenPoint.
view := self viewFromId:id.
view isNil ifTrue:[
- "/ search on other devices (if present).
- "/ This may find the view, in case another device
- "/ has its views on the same display screen
- "/ (i.e. under X, if its another display connection to the same
- "/ X-server)
- Screen allScreens do:[:aScreen |
- |v|
-
- aScreen ~~ self ifTrue:[
- (v := aScreen viewFromId:id) notNil ifTrue:[
- ^ v
- ]
- ]
- ]
+ "/ search on other devices (if present).
+ "/ This may find the view, in case another device
+ "/ has its views on the same display screen
+ "/ (i.e. under X, if its another display connection to the same
+ "/ X-server)
+ self class allScreens do:[:aScreen |
+ |v|
+
+ aScreen ~~ self ifTrue:[
+ (v := aScreen viewFromId:id) notNil ifTrue:[
+ ^ v
+ ]
+ ]
+ ]
].
^ view