From 77f3cc55062c9fcee4076b6a9e6d600f3ea34790 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Thu, 11 Feb 2021 22:27:28 -0600 Subject: [PATCH] Bug 2416 - Mac: Grabbers of other toolbars get "pushed" when dragging another toolbar over them --- src/widgets/Grabber.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/widgets/Grabber.cpp b/src/widgets/Grabber.cpp index 35d2a909c..ed1057bab 100644 --- a/src/widgets/Grabber.cpp +++ b/src/widgets/Grabber.cpp @@ -215,6 +215,16 @@ void Grabber::OnLeftDown(wxMouseEvent & event) // void Grabber::OnEnter(wxMouseEvent & WXUNUSED(event)) { +#if defined(__WXMAC__) + // Bug 2416: On Mac, we can get Enter events from grabbers other + // than the one being dragged. So, ignore Enter events if another + // window has captured the mouse. + if (wxWindow::GetCapture() != nullptr) + { + return; + } +#endif + // Bug 1201: On Mac, unsetting and re-setting the tooltip may be needed // to make it pop up when we want it. const auto text = GetToolTipText(); @@ -234,6 +244,16 @@ void Grabber::OnEnter(wxMouseEvent & WXUNUSED(event)) // void Grabber::OnLeave(wxMouseEvent & WXUNUSED(event)) { +#if defined(__WXMAC__) + // Bug 2416: On Mac, we can get Leave events from grabbers other + // than the one being dragged. So, ignore Leave events if another + // window has captured the mouse. + if (wxWindow::GetCapture() != nullptr) + { + return; + } +#endif + if (!GetCapture()) { // Redraw plain mOver = false;