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.
This commit is contained in:
Vadim Zeitlin 2023-12-24 17:21:12 +01:00
parent b1c9ebd7be
commit 45d7ac6d94
2 changed files with 8 additions and 15 deletions

View file

@ -485,8 +485,6 @@ public:
virtual void ShowHint(const wxRect& rect);
virtual void HideHint();
void OnHintActivate(wxActivateEvent& event);
public:
// deprecated -- please use SetManagedWindow()

View file

@ -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)