From 5b277dc9f8ae11c8bd36be9d2a3ed1d47d420cb0 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Tue, 30 Jul 2019 11:26:46 +0100 Subject: [PATCH] Bug 1723 - Keyboard Preferences: Closing subtrees. Closing sub trees can leave the wrong item selected. If a node near the bottom of the tree is closed, the node may move down, and no longer be under the mouse pointer. If further processing is allowed, then the line at the mouse position is incorrectly selected. Fix: Don't allow further processing and call SetFocus() ourselves. --- src/widgets/KeyView.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/widgets/KeyView.cpp b/src/widgets/KeyView.cpp index 6a3b435c8..0068df897 100644 --- a/src/widgets/KeyView.cpp +++ b/src/widgets/KeyView.cpp @@ -1656,6 +1656,14 @@ KeyView::OnLeftDown(wxMouseEvent & event) // And make sure current line is still selected SelectNode(LineToIndex(line)); + + // If a node is closed near the bottom of the tree, + // the node may move down, and no longer be at the + // mouse pointer position. So don't allow further processing as this + // selects the line at the mouse position. Bug 1723. + // So we need to set the focus. + SetFocus(); + return; } }