From e55e1a5fda0be9114123671b0e595936238b43b4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 7 Oct 2012 22:40:06 +0000 Subject: [PATCH] Don't set focus explicitly in wxGenericListCtrl mouse handling code. Just skip the event to allow the system to set the focus to the control itself. This is more consistent with the other controls and should result in correct behaviour everywhere automatically. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index e8e6b26b34..a5aee6314b 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2300,7 +2300,10 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) #endif // __WXMAC__ if ( event.LeftDown() ) - SetFocus(); + { + // Ensure we skip the event to let the system set focus to this window. + event.Skip(); + } // Pretend that the event happened in wxListCtrl itself. wxMouseEvent me(event); -- 2.47.2