diff --git a/collects/mred/private/wx/cocoa/frame.rkt b/collects/mred/private/wx/cocoa/frame.rkt index c6d31f78f9..af9af88a1c 100644 --- a/collects/mred/private/wx/cocoa/frame.rkt +++ b/collects/mred/private/wx/cocoa/frame.rkt @@ -467,7 +467,7 @@ (define/override (flip y h) (flip-screen (+ y h))) (define/override (get-y) - (- (super get-y) (if caption? 22 0))) + (- (- (super get-y) (if caption? 22 0)) (get-menu-bar-height))) (define/override (set-size x y w h) (unless (and (= x -1) (= y -1)) diff --git a/collects/mred/private/wx/cocoa/menu-bar.rkt b/collects/mred/private/wx/cocoa/menu-bar.rkt index 208be17b40..c16e81cfea 100644 --- a/collects/mred/private/wx/cocoa/menu-bar.rkt +++ b/collects/mred/private/wx/cocoa/menu-bar.rkt @@ -83,12 +83,6 @@ (and (<= x (NSPoint-x p) (+ x w)) (<= (- y h) (NSPoint-y p) y))))))) - -(define initial-menubar-height - (inexact->exact (floor (tell #:type _CGFloat cocoa-mb menuBarHeight)))) -(define (get-menu-bar-height) - initial-menubar-height) - (set-menu-bar-hooks! in-menu-bar-range) ;; Init menu bar @@ -205,3 +199,9 @@ (send top-wx on-menu-click)))))) (super-new)) + +(define initial-menubar-height + (inexact->exact (floor (tell #:type _CGFloat cocoa-mb menuBarHeight)))) + +(define (get-menu-bar-height) + initial-menubar-height) diff --git a/collects/mred/private/wx/cocoa/procs.rkt b/collects/mred/private/wx/cocoa/procs.rkt index da2ca303f4..a974d19263 100644 --- a/collects/mred/private/wx/cocoa/procs.rkt +++ b/collects/mred/private/wx/cocoa/procs.rkt @@ -63,7 +63,7 @@ file-selector key-symbol-to-menu-key) -(import-class NSScreen NSCursor) +(import-class NSScreen NSCursor NSMenu) (define (find-graphical-system-path what) #f) @@ -106,7 +106,13 @@ (tell #:type _NSRect screen frame) (tell #:type _NSRect screen visibleFrame))]) (set-box! xb (->long (NSSize-width (NSRect-size f)))) - (set-box! yb (->long (NSSize-height (NSRect-size f)))))))) + (set-box! yb (->long (- (NSSize-height (NSRect-size f)) + (cond + [all? 0] + [(tell #:type _BOOL NSMenu menuBarVisible) 0] + ;; Make result consistent when menu bar is hidden: + [else + (get-menu-bar-height)])))))))) (define-appkit NSBeep (_fun -> _void)) (define (bell) (NSBeep))