From cd9a8fb695ad068c8df155d4c5c9ad061c5b2a08 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 2 Sep 2019 10:59:06 +0100 Subject: [PATCH] Do not switch state if drag-and-drop is not allowed in wxTreeCtrl Avoid setting state to DragSelectingState unless dragging items in wxTreeCtrl is explicitly allowed, as this this causes bad behaviour downstream with subsequent selections when the client does anything in the event handler beyond simply not allowing the event. Basically, we can't be guaranteed of the mouse state on return from the event handler, so dropping into drag selection mode is potentially inappropriate (or just plain bad). Closes https://github.com/wxWidgets/wxWidgets/pull/1523 --- src/qt/treectrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/treectrl.cpp b/src/qt/treectrl.cpp index 84213cec7f..ef478911bb 100644 --- a/src/qt/treectrl.cpp +++ b/src/qt/treectrl.cpp @@ -463,14 +463,14 @@ private: tree_event.SetPoint(wxQtConvertPoint(event->pos())); - // Vetoed unless explicitly accepted. + // Client must explicitly accept drag and drop. Vetoed by default. tree_event.Veto(); EmitEvent(tree_event); if ( !tree_event.IsAllowed() ) { - setState(DragSelectingState); + setState(NoState); } }