Fix window positioning on OS X

db4
Slava Pestov 2009-04-13 03:16:57 -05:00
parent b75e6ff445
commit 3b1f3c08a4
1 changed files with 6 additions and 3 deletions

View File

@ -39,13 +39,16 @@ M: pasteboard set-clipboard-contents
[ 0 0 ] dip dim>> first2 <CGRect> ; [ 0 0 ] dip dim>> first2 <CGRect> ;
: auto-position ( window loc -- ) : auto-position ( window loc -- )
#! Note: if this is the initial window, the length of the windows
#! vector should be 1, since (open-window) calls auto-position
#! after register-window.
dup { 0 0 } = [ dup { 0 0 } = [
drop drop
windows get [ -> center ] [ windows get length 1 <= [ -> center ] [
peek second window-loc>> windows get peek second window-loc>>
dupd first2 <CGPoint> -> cascadeTopLeftFromPoint: dupd first2 <CGPoint> -> cascadeTopLeftFromPoint:
-> setFrameTopLeftPoint: -> setFrameTopLeftPoint:
] if-empty ] if
] [ first2 <CGPoint> -> setFrameTopLeftPoint: ] if ; ] [ first2 <CGPoint> -> setFrameTopLeftPoint: ] if ;
M: cocoa-ui-backend set-title ( string world -- ) M: cocoa-ui-backend set-title ( string world -- )