diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index 966b26f7cf..87bc77ab66 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -501,6 +501,8 @@ public: virtual void ShowHint(const wxRect& rect); virtual void HideHint(); + void OnHintActivate(wxActivateEvent& event); + public: // deprecated -- please use SetManagedWindow() and diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index c2861cf84c..20ea5a6c73 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -814,6 +814,8 @@ void wxAuiManager::UpdateHintWindowConfig() wxDefaultPosition, wxSize(1,1), wxFRAME_FLOAT_ON_PARENT | wxFRAME_TOOL_WINDOW ); + m_hint_wnd->Connect(wxEVT_ACTIVATE, + wxActivateEventHandler(wxAuiManager::OnHintActivate), NULL, this); // Can't set the bg colour of a Frame in wxMac wxPanel* p = new wxPanel(m_hint_wnd); @@ -3298,6 +3300,17 @@ 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 behavior 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,