cocoa: fix sign on `get-display-left-top-inset' x result

Also fix frame placement on screens other than the main screen.

original commit: 3ab067bc338406848e937f388343fb1e2ffa3074
This commit is contained in:
Matthew Flatt 2011-08-10 11:13:00 -06:00
parent aa28c178f8
commit 1ff4328f2b
2 changed files with 2 additions and 2 deletions

View File

@ -468,7 +468,7 @@
(tell cocoa enableCursorRects)))
(define/public (flip-screen y)
(let ([f (tell #:type _NSRect (tell cocoa screen) frame)])
(let ([f (tell #:type _NSRect (tell NSScreen mainScreen) frame)])
(- (NSSize-height (NSRect-size f)) y)))
(define/override (flip y h) (flip-screen (+ y h)))

View File

@ -99,7 +99,7 @@
[f (if (zero? num)
(tell #:type _NSRect screen visibleFrame)
(tell #:type _NSRect screen frame))])
(set-box! xb (->long (NSPoint-x (NSRect-origin f))))
(set-box! xb ((if (and all? (zero? num)) + -) (->long (NSPoint-x (NSRect-origin f)))))
(unless (zero? num)
(let* ([screen0 (tell screens objectAtIndex: #:type _NSUInteger 0)]
[f0 (tell #:type _NSRect screen0 frame)])