]> git.saurik.com Git - wxWidgets.git/commitdiff
Prevent activation of the AUI hint window (mini frame) on Mac.
authorBryan Petty <bryan@ibaku.net>
Fri, 7 Nov 2008 00:47:35 +0000 (00:47 +0000)
committerBryan Petty <bryan@ibaku.net>
Fri, 7 Nov 2008 00:47:35 +0000 (00:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/aui/framemanager.h
src/aui/framemanager.cpp

index 966b26f7cfe076cabd1d303e2244393c1e7f36f1..87bc77ab6635223e2ca4a282b5db1f6b2646eadc 100644 (file)
@@ -501,6 +501,8 @@ public:
     virtual void ShowHint(const wxRect& rect);
     virtual void HideHint();
 
+    void OnHintActivate(wxActivateEvent& event);
+
 public:
 
     // deprecated -- please use SetManagedWindow() and
index c2861cf84c561b6641e7b8630264fab7bb724fd1..20ea5a6c73261cb517877c7f4d7fb69a8e3397e1 100644 (file)
@@ -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,