From c843108e8da98fcf268743464958b16f7d7b465a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 17 Apr 2016 20:54:40 -0600 Subject: [PATCH] OS X: disable reordering of tabs in the new `tab-panel%` widget Fixes racket/drracket#52 (cherry picked from commit f0d10e9cc830cb006a29ccff4377ec6f57b41df8) --- gui-lib/mred/private/wx/cocoa/tab-panel.rkt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gui-lib/mred/private/wx/cocoa/tab-panel.rkt b/gui-lib/mred/private/wx/cocoa/tab-panel.rkt index d7ff5e95..341c183e 100644 --- a/gui-lib/mred/private/wx/cocoa/tab-panel.rkt +++ b/gui-lib/mred/private/wx/cocoa/tab-panel.rkt @@ -68,7 +68,8 @@ (queue-window*-event wxb (lambda (wx) (send wx do-callback))))))) ;; The MMTabBarView widget doesn't support disabling, so we have to -;; implement it: +;; implement it. Also, we need to override a method to disable (for now) +;; reordering tabs. (define-objc-mixin (EnableMixin Superclass) [wxb] (-a _id (hitTest: [_NSPoint pt]) @@ -76,7 +77,9 @@ (if (and wx (not (send wx is-enabled-to-root?))) #f - (super-tell hitTest: #:type _NSPoint pt))))) + (super-tell hitTest: #:type _NSPoint pt)))) + (-a _BOOL (shouldStartDraggingAttachedTabBarButton: b withMouseDownEvent: evt) + #f)) ;; A no-op mixin instead of `EnableMixin` for PSMTabBarControl: (define-objc-mixin (EmptyMixin Superclass)