From 2d18aaf58a1b5c6d6fe9960f282d478e392a5c31 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Dec 2018 20:48:32 +0100 Subject: [PATCH] Move check for mouse button down events in wxDataViewMainWindow No real changes, just prepare for the next commit. --- src/generic/datavgen.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 448a58bf5b..f5c60b3953 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4525,14 +4525,6 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) return; } - if(event.ButtonDown()) - { - // Not skipping button down events would prevent the system from - // setting focus to this window as most (all?) of them do by default, - // so skip it to enable default handling. - event.Skip(); - } - int x = event.GetX(); int y = event.GetY(); m_owner->CalcUnscrolledPosition( x, y, &x, &y ); @@ -4560,6 +4552,14 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) const unsigned int current = GetLineAt( y ); const wxDataViewItem item = GetItemByRow(current); + if(event.ButtonDown()) + { + // Not skipping button down events would prevent the system from + // setting focus to this window as most (all?) of them do by default, + // so skip it to enable default handling. + event.Skip(); + } + // Handle right clicking here, before everything else as context menu // events should be sent even when we click outside of any item, unlike all // the other ones.