#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Sat, 18 Mar 2017 16:45:58 +0100
changeset 7985 d29e04d1b3ad
parent 7984 2986529ac6ee
child 7986 987d14f396e7
#BUGFIX by stefan class: StandardSystemView changed: #physicalCreate handle nil values for top/left
StandardSystemView.st
--- a/StandardSystemView.st	Sat Mar 18 16:41:07 2017 +0100
+++ b/StandardSystemView.st	Sat Mar 18 16:45:58 2017 +0100
@@ -1505,40 +1505,43 @@
 
     dev := device.
     currentUserPrefs := UserPreferences current.
-    currentUserPrefs forceWindowsIntoMonitorBounds ifTrue:[
-	"/ MULTI SCREEN support
-	devBounds := dev monitorBoundsAt:( left @ top ).
-	"/ adjust origin, if too large
-	left + width > devBounds right ifTrue:[
-	    left := devBounds right - width.
-	].
-	top + height > devBounds bottom ifTrue:[
-	    top := devBounds bottom - height.
-	].
-	top  := top  max:(devBounds top).
-	left := left max:(devBounds left).
+
+    (top notNil and:[left notNil]) ifTrue:[
+        currentUserPrefs forceWindowsIntoMonitorBounds ifTrue:[
+            "/ MULTI SCREEN support
+            devBounds := dev monitorBoundsAt:( left @ top ).
+            "/ adjust origin, if too large
+            left + width > devBounds right ifTrue:[
+                left := devBounds right - width.
+            ].
+            top + height > devBounds bottom ifTrue:[
+                top := devBounds bottom - height.
+            ].
+            top  := top  max:(devBounds top).
+            left := left max:(devBounds left).
+        ].
+
+        dev isWindowsPlatform ifTrue:[
+            top := top + dev captionHeight.
+        ].
+        org := (left @ top) rounded.
     ].
 
-    dev isWindowsPlatform ifTrue:[
-	top := top + dev captionHeight.
-    ].
-    org := (left @ top) rounded.
     lbl := self windowLabelFor:label.
 
     icon notNil ifTrue:[
-	iconValue := icon value.
-	icn := dev convertedIcon:iconValue.
-	(icnMask := iconValue mask) notNil ifTrue:[
-	    icnMask := dev convertedIconMask:icnMask.
-	].
-	"this is to keep the references"
-	deviceIcon := Array with:icn with:icnMask.
+        iconValue := icon value.
+        icn := dev convertedIcon:iconValue.
+        (icnMask := iconValue mask) notNil ifTrue:[
+            icnMask := dev convertedIconMask:icnMask.
+        ].
+        "this is to keep the references"
+        deviceIcon := Array with:icn with:icnMask.
     ].
 
     "/ give global eventListeners a chance to intercept windowCreation
     "/ and provide another origin (by payching my origin via setOrigin:).
     WindowSensor preViewCreateNotification:self.
-
     gc
       createWindowFor:self
       type:(self windowType)
@@ -1573,17 +1576,17 @@
 "/  ].
 
     viewShape notNil ifTrue:[
-	self setViewShape
+        self setViewShape
     ].
 
     (backed notNil and:[backed ~~ false]) ifTrue:[
-	self backingStore:backed.
+        self backingStore:backed.
     ].
     self saveUnder ifTrue:[
-	self saveUnder:true.
+        self saveUnder:true.
     ].
     cursor notNil ifTrue:[
-	self setCursor
+        self setCursor
     ].
 
     "/JV@2012-11-11: Updated to be ICCCM 2.0 Compliant - some modern Window managers
@@ -1594,38 +1597,38 @@
     "/               http://tronche.com/gui/x/icccm/sec-4.html
 
     (currentUserPrefs icccm20Compliant == true) ifTrue:[
-	"/ICCCM 2.0 compliant name & class. See ICCCM 2.0 section 4.1.2.5.
+        "/ICCCM 2.0 compliant name & class. See ICCCM 2.0 section 4.1.2.5.
 
-	| commandName lastSepIndex |
+        | commandName lastSepIndex |
 
-	commandName := Smalltalk commandName.
-	lastSepIndex := commandName lastIndexOf: Filename separator.
-	windowNameString := commandName copyFrom: lastSepIndex + 1.
-	windowClassNameString := windowNameString asUppercaseFirst.
+        commandName := Smalltalk commandName.
+        lastSepIndex := commandName lastIndexOf: Filename separator.
+        windowNameString := commandName copyFrom: lastSepIndex + 1.
+        windowClassNameString := windowNameString asUppercaseFirst.
 
-	"/ Also, set _NET_WM_PID
-	self setWindowPid: nil.
+        "/ Also, set _NET_WM_PID
+        self setWindowPid: nil.
     ] ifFalse:[
-	"/ Old code..."
-	application notNil ifTrue:[
-	    windowClassNameString := application class name.
-	] ifFalse:[
-	    (self class == StandardSystemView and:[subViews size == 1]) ifTrue:[
-		"This is a subclass of SimpleView wrapped into a StandardSystemView"
-		windowClassNameString := subViews first class name.
-	    ] ifFalse:[
-		windowClassNameString := self class name.
-	    ]
-	].
-	windowClassNameString := 'Stx.', windowClassNameString.
-	windowNameString := 'main'.
+        "/ Old code..."
+        application notNil ifTrue:[
+            windowClassNameString := application class name.
+        ] ifFalse:[
+            (self class == StandardSystemView and:[subViews size == 1]) ifTrue:[
+                "This is a subclass of SimpleView wrapped into a StandardSystemView"
+                windowClassNameString := subViews first class name.
+            ] ifFalse:[
+                windowClassNameString := self class name.
+            ]
+        ].
+        windowClassNameString := 'Stx.', windowClassNameString.
+        windowNameString := 'main'.
     ].
 
     self windowClass:windowClassNameString name:windowNameString.
 
-    "Modified: / 14-06-1996 / 17:14:25 / stefan"
     "Modified: / 04-01-2013 / 16:13:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 22-05-2015 / 21:09:35 / cg"
+    "Modified: / 18-03-2017 / 00:30:15 / stefan"
 !
 
 postRealize