From e1dcfc73d137246a1c2761464fc2ce8010aaa909 Mon Sep 17 00:00:00 2001 From: Anton Triest Date: Wed, 11 Mar 2020 00:01:47 +0100 Subject: [PATCH] Don't show selected tree item when using multiple selection This is appropriate for single selection, where the selected item is also always the focused one, but not in the multiple selection case. And wxMSW native version already behaves like this, so this makes the generic one consistent with it. Closes #18691. --- src/generic/treectlg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 9041ce101a..112894060e 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2194,7 +2194,8 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId, // This can cause idle processing to select the root // if no item is selected, so it must be after the // selection is set - EnsureVisible( itemId ); + if (is_single) + EnsureVisible( itemId ); event.SetEventType(wxEVT_TREE_SEL_CHANGED); GetEventHandler()->ProcessEvent( event );