From: Vadim Zeitlin Date: Sun, 7 Oct 2012 22:39:43 +0000 (+0000) Subject: Don't set focus to generic wxDataViewCtrl on any button press. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6ceda4f536a79ee9c7dcf7db1c67750a8198aac7 Don't set focus to generic wxDataViewCtrl on any button press. Only set focus if the left button was pressed for consistency with just about everything else. Also, just skip the event instead of setting the focus explicitly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 0317ea8144..c4a11e828c 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3939,9 +3939,12 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) return; } - // set the focus to ourself if any of the mouse buttons are pressed - if(event.ButtonDown() && !HasFocus()) - SetFocus(); + if(event.LeftDown()) + { + // Not skipping this event would prevent the system from setting focus + // to this window. + event.Skip(); + } int x = event.GetX(); int y = event.GetY();