--- a/UIPainter.st Thu Dec 05 14:44:11 2013 +0100
+++ b/UIPainter.st Fri Dec 06 10:49:39 2013 +0100
@@ -4646,9 +4646,9 @@
"spread the painter and gallery views on the screen"
|myWindow canvasWindow canvasOrg galleryWindow
- galleryOrg myOrg myCorner windowGroup|
-
- super postOpenWith: aBuilder.
+ galleryOrg windowGroup monitorBounds myViewRectangle|
+
+ super postOpenWith:aBuilder.
windowGroup := self topApplication windowGroup.
windowGroup addPreEventHook:self.
@@ -4664,30 +4664,26 @@
galleryWindow := selectionPanel window.
- myOrg := myWindow origin.
- myCorner := myWindow corner.
-
"/ try to lay out things non-overlapping
- true
-
"/ but only, if the window manager placed all windows
"/ on top of each other
- "/ myOrg = canvasWindow origin
-
- ifTrue:[
-
- canvasOrg := 10@20.
-"/ myOrg := (device width - myWindow width - 20) @ 20.
- galleryOrg := (device width - galleryWindow width - 20)
+ "/ make sure, that all the windows are on the same physical monitor
+ monitorBounds := device monitorBoundsAt:self window origin.
+ myViewRectangle := myWindow screenBounds.
+ (myViewRectangle intersects:galleryWindow screenBounds) ifTrue:[
+ galleryOrg := (monitorBounds right - galleryWindow width - 20)
@
- ((myWindow height + 20) min:(device height - galleryWindow height - 20)).
- myWindow origin:myOrg.
-
- canvasWindow origin:canvasOrg.
- galleryWindow origin:galleryOrg.
-
- galleryWindow raise.
- canvasWindow raise.
+ ((myWindow bottom + 20) min:(monitorBounds bottom - galleryWindow height - 20)).
+ galleryWindow
+ origin:galleryOrg;
+ raise.
+ ].
+ ((myViewRectangle intersects:canvasWindow screenBounds)
+ or:[galleryWindow screenBounds intersects:canvasWindow screenBounds])ifTrue:[
+ canvasOrg := monitorBounds origin + (10@20).
+ canvasWindow
+ origin:canvasOrg;
+ raise.
].
self setupCanvasAndSelectionPanel.
@@ -4695,10 +4691,11 @@
"/ selectionPanel window waitUntilVisible.
"/ painterView window waitUntilVisible.
"/ self window waitUntilVisible.
- [ Delay waitForSeconds:0.1.
- self window topView raise.
+ [
+ Delay waitForSeconds:0.1.
+ myWindow topView raise.
Delay waitForSeconds:0.25.
- self window topView raise
+ myWindow topView raise
] fork.
"Modified: / 13.7.1999 / 21:26:52 / cg"
!