diff --git a/collects/mred/private/wx/cocoa/frame.rkt b/collects/mred/private/wx/cocoa/frame.rkt index 376fc7f5d7..e0a6da453d 100644 --- a/collects/mred/private/wx/cocoa/frame.rkt +++ b/collects/mred/private/wx/cocoa/frame.rkt @@ -402,7 +402,8 @@ (define/override (move x y) (let ([x (if (= x -11111) (get-x) x)] [y (if (= y -11111) (get-y) y)]) - (tellv cocoa setFrameTopLeftPoint: #:type _NSPoint (make-NSPoint x (flip-screen y))))) + (tellv cocoa setFrameTopLeftPoint: #:type _NSPoint (make-NSPoint x (- (flip-screen y) + (get-menu-bar-height)))))) (define/override (center dir wrt) (let ([f (tell #:type _NSRect cocoa frame)] diff --git a/collects/mred/private/wx/cocoa/menu-bar.rkt b/collects/mred/private/wx/cocoa/menu-bar.rkt index df57b133e3..1facf8d91a 100644 --- a/collects/mred/private/wx/cocoa/menu-bar.rkt +++ b/collects/mred/private/wx/cocoa/menu-bar.rkt @@ -10,7 +10,8 @@ "const.rkt" "queue.rkt") -(provide menu-bar%) +(provide menu-bar% + get-menu-bar-height) (import-class NSApplication NSMenu NSMenuItem NSProcessInfo NSScreen) @@ -59,6 +60,9 @@ (and (<= x (NSPoint-x p) (+ x w)) (<= (- y h) (NSPoint-y p) y))))))) +(define (get-menu-bar-height) + (inexact->exact (floor (tell #:type _CGFloat cocoa-mb menuBarHeight)))) + (set-menu-bar-hooks! in-menu-bar-range) ;; Init menu bar diff --git a/collects/mred/private/wx/cocoa/procs.rkt b/collects/mred/private/wx/cocoa/procs.rkt index 22f38a0f22..4f8a8f5c9a 100644 --- a/collects/mred/private/wx/cocoa/procs.rkt +++ b/collects/mred/private/wx/cocoa/procs.rkt @@ -11,6 +11,7 @@ "finfo.rkt" ; file-creator-and-type "filedialog.rkt" "dc.rkt" + "menu-bar.rkt" "../../lock.rkt" "../common/handlers.rkt") @@ -101,12 +102,16 @@ (define (display-origin xb yb all?) (set-box! xb 0) - (set-box! yb 0)) -(define (display-size xb yb v) + (if all? + (set-box! yb 0) + (set-box! yb (get-menu-bar-height)))) +(define (display-size xb yb all?) (atomically (with-autorelease (let* ([screen (tell (tell NSScreen screens) objectAtIndex: #:type _NSUInteger 0)] - [f (tell #:type _NSRect screen frame)]) + [f (if all? + (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)))))))) diff --git a/collects/mred/private/wx/gtk/menu.rkt b/collects/mred/private/wx/gtk/menu.rkt index 9cb4a3a52b..68d59b2136 100644 --- a/collects/mred/private/wx/gtk/menu.rkt +++ b/collects/mred/private/wx/gtk/menu.rkt @@ -182,7 +182,8 @@ (public [append-item append]) (define (append-item i label help-str-or-submenu chckable?) (atomically - (let ([item-gtk ((if chckable? + (let ([item-gtk ((if (and chckable? + (not (help-str-or-submenu . is-a? . menu%))) gtk_check_menu_item_new_with_mnemonic gtk_menu_item_new_with_mnemonic) (fixup-mneumonic label))]) diff --git a/collects/mred/private/wxtop.rkt b/collects/mred/private/wxtop.rkt index 781a327818..80cb5d14ff 100644 --- a/collects/mred/private/wxtop.rkt +++ b/collects/mred/private/wxtop.rkt @@ -35,7 +35,7 @@ (opt-lambda ([full-screen? #f]) (let ([xb (box 0)] [yb (box 0)]) - (wx:display-size xb yb (if full-screen? 1 0)) + (wx:display-size xb yb full-screen?) (values (unbox xb) (unbox yb))))) (define get-display-left-top-inset