]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix tree control focus issues on OS X (and possibly others) caused by toplevel.cpp...
authorKevin Hock <hockkn@yahoo.com>
Wed, 17 Nov 2004 02:33:58 +0000 (02:33 +0000)
committerKevin Hock <hockkn@yahoo.com>
Wed, 17 Nov 2004 02:33:58 +0000 (02:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index ed8dacdd7bb8d3b947272390aaa09121a7006714..04c73b4e20829e76a332ad233105b734182bea5b 100644 (file)
@@ -3129,6 +3129,16 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
     }
     else
     {
+        // If we got to this point, we are not dragging or moving the mouse.
+        // Because the code in carbon/toplevel.cpp will only set focus to the tree
+        // if we skip for EVT_LEFT_DOWN, we MUST skip this event here for focus to work.
+        // We skip even if we didn't hit an item because we still should
+        // restore focus to the tree control even if we didn't exactly hit an item.
+        if ( event.LeftDown() )
+        {
+            event.Skip();
+        }
+
         // here we process only the messages which happen on tree items
 
         m_dragCount = 0;