cocoa get-display-size: use screen with menu bar

original commit: 158d119b12a0fe1a41211dcc7152a705c1935c37
This commit is contained in:
Matthew Flatt 2010-09-17 21:17:02 -06:00
parent 2a3bdeb69b
commit 9faffb56b7

View File

@ -103,9 +103,12 @@
(set-box! xb 0)
(set-box! yb 0))
(define (display-size xb yb v)
(let ([f (tell #:type _NSRect (tell NSScreen mainScreen) frame)])
(set-box! xb (->long (NSSize-width (NSRect-size f))))
(set-box! yb (->long (NSSize-height (NSRect-size f))))))
(atomically
(with-autorelease
(let* ([screen (tell (tell NSScreen screens) objectAtIndex: #:type _NSUInteger 0)]
[f (tell #:type _NSRect screen frame)])
(set-box! xb (->long (NSSize-width (NSRect-size f))))
(set-box! yb (->long (NSSize-height (NSRect-size f))))))))
(define-appkit NSBeep (_fun -> _void))
(define (bell) (NSBeep))