From e4899fd770f825fbef569a56684bbd506ae73988 Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Wed, 17 Nov 2004 02:33:58 +0000 Subject: [PATCH] Fix tree control focus issues on OS X (and possibly others) caused by toplevel.cpp not giving focus if children eat the LEFT_DOWN event... added event.Skip() on LeftDown() (whether an item is hit or not) after all dragging and moving conditions have been considered so that LEFT_DOWN events are never eaten by the tree preventing receiving focus git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index ed8dacdd7b..04c73b4e20 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -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; -- 2.45.2