From 429be954283cd8253bb30b7fd8cd28ff8af5abf0 Mon Sep 17 00:00:00 2001 From: Simeon Andreev Date: Tue, 28 Aug 2018 17:38:23 +0200 Subject: Bug 538303 - Debug View wrong selection if activated by breakpoint If a breakpoint is hit when the Debug View is not active, the Debug View is activated. In some cases, this leads to a bad selection and expanded state. When the Debug View is activated, either by a breakpoint or by a user, a state is saved in ViewerStateTracker. This state is cancelled by TreeModelContentProvider on breakpoint hit, however without removing COLLAPSED delta states. As such, applying the state later on will lead to a collapsed thread, if the state had a collapsed flag for that thread. This "overwrites" a thread selected by suspend handling. This change should ensure that COLLAPSED thread state in ViewerStateTracker is cleared when an expand is handled, regardless if the tree had to be expanded or was expanded already by another operation. Change-Id: I7c43b8317081747c6d8e85020e7040e928c4f39b Signed-off-by: Simeon Andreev --- org.eclipse.debug.ui/META-INF/MANIFEST.MF | 2 +- org.eclipse.debug.ui/pom.xml | 2 +- .../debug/internal/ui/viewers/model/TreeModelContentProvider.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.ui/META-INF/MANIFEST.MF index d0b52d626..ba80c4c5a 100644 --- a/org.eclipse.debug.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.debug.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true -Bundle-Version: 3.13.100.qualifier +Bundle-Version: 3.13.200.qualifier Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/org.eclipse.debug.ui/pom.xml b/org.eclipse.debug.ui/pom.xml index f9456beb9..f5796e14d 100644 --- a/org.eclipse.debug.ui/pom.xml +++ b/org.eclipse.debug.ui/pom.xml @@ -18,7 +18,7 @@ org.eclipse.debug org.eclipse.debug.ui - 3.13.100-SNAPSHOT + 3.13.200-SNAPSHOT eclipse-plugin -warn:+resource,-deprecation,unavoidableGenericProblems diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java index 4fc8d4ab6..4608c48b0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java @@ -1437,8 +1437,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon treeViewer.setChildCount(elementPath, viewCount); if (!treeViewer.getExpandedState(elementPath)) { treeViewer.expandToLevel(elementPath, 1); - cancelRestore(elementPath, IModelDelta.COLLAPSE); } + cancelRestore(elementPath, IModelDelta.COLLAPSE); } } -- cgit v1.2.3