WindowBuilder.st
changeset 1774 28b516fbd3e9
parent 1766 7e15dd50e11a
child 1825 19ccea76d6b3
--- a/WindowBuilder.st	Fri May 09 18:24:40 2003 +0200
+++ b/WindowBuilder.st	Tue May 13 18:11:17 2003 +0200
@@ -1244,7 +1244,7 @@
         as popUp (also blocking)
         or as a normal view."
 
-    |appWinClass device|
+    |appWinClass device wg mainWin|
 
     device := window device.
     origin notNil ifTrue:[
@@ -1266,7 +1266,16 @@
         or:[origin == #center]) ifTrue:[
             window origin:(device center - (window extent // 2))
         ] ifFalse:[
-            window fixPosition:(device pointerPosition - window positionOffset).
+            wg := WindowGroup activeGroup.
+            wg notNil ifTrue:[ 
+                wg := wg mainGroup.
+                mainWin := wg topViews firstIfEmpty:nil.
+            ].
+            mainWin notNil ifTrue:[
+                window origin:(mainWin center - (window extent // 2))
+            ] ifFalse:[
+                window fixPosition:(device pointerPosition - window positionOffset).
+            ]
         ].
         ^ window openModal.
     ].
@@ -1343,5 +1352,5 @@
 !WindowBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.109 2003-05-07 14:39:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.110 2003-05-13 16:11:17 cg Exp $'
 ! !