From 45d7ac6d94c35948bf463623b685213ff1848e14 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 Dec 2023 17:21:12 +0100 Subject: [PATCH] Don't define a separate wxAuiManager::OnHintActivate() This was only used under Mac but defined under all platforms. Don't bother with defining it elsewhere and just use a trivial empty lambda as wxEVT_ACTIVATE handler under Mac. Note that it's not really clear if this is still needed neither, but it doesn't cost much to keep this workaround just in case it is. --- include/wx/aui/framemanager.h | 2 -- src/aui/framemanager.cpp | 21 ++++++++------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index da9dff9609..61e9ae640a 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -485,8 +485,6 @@ public: virtual void ShowHint(const wxRect& rect); virtual void HideHint(); - void OnHintActivate(wxActivateEvent& event); - public: // deprecated -- please use SetManagedWindow() diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 133b34eb0c..e3ea6a1328 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -851,7 +851,14 @@ void wxAuiManager::UpdateHintWindowConfig() wxFRAME_NO_TASKBAR | wxNO_BORDER); #ifdef __WXMAC__ - m_hintWnd->Bind(wxEVT_ACTIVATE, &wxAuiManager::OnHintActivate, this); + // Do nothing so this event isn't handled in the base handlers. + + // Letting the hint window activate without this handler can lead to + // weird behaviour on Mac where the menu is switched out to the top + // window's menu in MDI applications when it shouldn't be. So since + // we don't want user interaction with the hint window anyway, we just + // prevent it from activating here. + m_hintWnd->Bind(wxEVT_ACTIVATE, [](wxActivateEvent&) {}); #endif m_hintWnd->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT)); @@ -3414,18 +3421,6 @@ void wxAuiManager::HideHint() } } -void wxAuiManager::OnHintActivate(wxActivateEvent& WXUNUSED(event)) -{ - // Do nothing so this event isn't handled in the base handlers. - - // Letting the hint window activate without this handler can lead to - // weird behaviour on Mac where the menu is switched out to the top - // window's menu in MDI applications when it shouldn't be. So since - // we don't want user interaction with the hint window anyway, we just - // prevent it from activating here. -} - - void wxAuiManager::StartPaneDrag(wxWindow* pane_window, const wxPoint& offset)