From 1ff4328f2b1aefe762423d518c252632f61dc638 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 10 Aug 2011 11:13:00 -0600 Subject: [PATCH] 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 --- collects/mred/private/wx/cocoa/frame.rkt | 2 +- collects/mred/private/wx/cocoa/procs.rkt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/collects/mred/private/wx/cocoa/frame.rkt b/collects/mred/private/wx/cocoa/frame.rkt index 37d5768d..81f35d67 100644 --- a/collects/mred/private/wx/cocoa/frame.rkt +++ b/collects/mred/private/wx/cocoa/frame.rkt @@ -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))) diff --git a/collects/mred/private/wx/cocoa/procs.rkt b/collects/mred/private/wx/cocoa/procs.rkt index db4551a2..e4ac4108 100644 --- a/collects/mred/private/wx/cocoa/procs.rkt +++ b/collects/mred/private/wx/cocoa/procs.rkt @@ -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)])