Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329049

Summary: [breadcrumb] Debug core sends empty selection event when views max -> restored
Product: [Eclipse Project] Platform Reporter: Alan Boxall <boxall>
Component: DebugAssignee: Pawel Piech <pawel.1.piech>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, pawel.1.piech, swanj
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 358382, 358432    

Description Alan Boxall CLA 2010-10-29 10:00:18 EDT
Build Identifier: 3.6.1 M20101013-0800

This behavior is new in 3.6 (compared to 3.4)
The launch view (Debug view) is sending an empty selection event when a view in the same perspective is maximized and then restored.

Another case of an empty selection event is when the debug view is resized and causes it to switch to the bread crumb mode.  At the moment the switch is made an empty selection event is sent:

org.eclipse.debug.internal.ui.views.launch.LaunchView@1d2a1d2a,<empty selection>

Views and actions that react to selection events in the debug view are disabled or show no content because they think there is nothing selected in the UI.

I do understand that using the debug context is the preferred method over selection events but this bug causes older views and actions to stop working.

Here is the call stack when the empty event is sent

Thread [main] (Suspended (entry into method selectionChanged in ModulesView))	
	ModulesView.selectionChanged(IWorkbenchPart, ISelection) line: 226	
	AbstractPartSelectionTracker$1.run() line: 119	
	SafeRunner.run(ISafeRunnable) line: 42	
	Platform.run(ISafeRunnable) line: 888	
	WindowPartSelectionTracker(AbstractPartSelectionTracker).fireSelection(IWorkbenchPart, ISelection) line: 117	
	WindowPartSelectionTracker$1.selectionChanged(IWorkbenchPart, ISelection) line: 38	
	AbstractPartSelectionTracker$1.run() line: 119	
	SafeRunner.run(ISafeRunnable) line: 42	
	Platform.run(ISafeRunnable) line: 888	
	PagePartSelectionTracker(AbstractPartSelectionTracker).fireSelection(IWorkbenchPart, ISelection) line: 117	
	PagePartSelectionTracker$1.selectionChanged(SelectionChangedEvent) line: 49	
	PageBookView$5.run() line: 255	
	SafeRunner.run(ISafeRunnable) line: 42	
	Platform.run(ISafeRunnable) line: 888	
	PageBookView$SelectionManager.selectionChanged(SelectionChangedEvent) line: 253	
	PageBookView$SelectionProvider.selectionChanged(SelectionChangedEvent) line: 319	
	LaunchView(PageBookView).pageSelectionChanged(SelectionChangedEvent) line: 896	
	PageBookView.access$2(PageBookView, SelectionChangedEvent) line: 891	
	PageBookView$2.selectionChanged(SelectionChangedEvent) line: 163	
	Viewer$2.run() line: 162	
	SafeRunner.run(ISafeRunnable) line: 42	
	JFaceUtil$1.run(ISafeRunnable) line: 49	
	SafeRunnable.run(ISafeRunnable) line: 175	
	LaunchViewBreadcrumb$1(Viewer).fireSelectionChanged(SelectionChangedEvent) line: 160	
	LaunchViewBreadcrumb$1(StructuredViewer).updateSelection(ISelection) line: 2162	
	LaunchViewBreadcrumb$1(StructuredViewer).setSelection(ISelection, boolean) line: 1699	
	LaunchViewBreadcrumb$1(Viewer).setSelection(ISelection) line: 392	
	LaunchViewBreadcrumb.debugContextChanged(DebugContextEvent) line: 317	
	LaunchView.showBreadcrumbPage() line: 790	
	LaunchView.autoSelectViewPage(Composite) line: 753	
	LaunchView.access$3(LaunchView, Composite) line: 750	
	LaunchView$3.controlResized(ControlEvent) line: 610	
	TypedListener.handleEvent(Event) line: 228	
	EventTable.sendEvent(Event) line: 84	
	Composite(Widget).sendEvent(Event) line: 1053	
	Composite(Widget).sendEvent(int, Event, boolean) line: 1077	
	Composite(Widget).sendEvent(int) line: 1058	
	Composite(Control).WM_SIZE(int, int) line: 4813	
	Composite(Scrollable).WM_SIZE(int, int) line: 291	
	Composite.WM_SIZE(int, int) line: 1653	
	Composite(Control).windowProc(int, int, int, int) line: 4234	
	Display.windowProc(int, int, int, int) line: 4873	
	OS.DefWindowProcW(int, int, int, int) line: not available [native method]	
	OS.DefWindowProc(int, int, int, int) line: 2454	
	Composite(Scrollable).callWindowProc(int, int, int, int) line: 80	
	Composite(Control).WM_WINDOWPOSCHANGED(int, int) line: 4970	
	Composite(Control).windowProc(int, int, int, int) line: 4244	
	Display.windowProc(int, int, int, int) line: 4873	
	OS.SetWindowPos(int, int, int, int, int, int, int) line: not available [native method]	
	Composite(Widget).SetWindowPos(int, int, int, int, int, int, int) line: 1456	
	Composite(Control).setBounds(int, int, int, int, int, boolean) line: 2816	
	Composite.setBounds(int, int, int, int, int, boolean) line: 1018	
	Composite(Control).setBounds(int, int, int, int, int) line: 2777	
	Composite(Control).setBounds(int, int, int, int) line: 2773	
	FillLayout.layout(Composite, boolean) line: 201	
	Composite.updateLayout(boolean, boolean) line: 1275	
	Composite.WM_SIZE(int, int) line: 1664	
	Composite(Control).windowProc(int, int, int, int) line: 4234	
	Display.windowProc(int, int, int, int) line: 4873	
	OS.DefWindowProcW(int, int, int, int) line: not available [native method]	
	OS.DefWindowProc(int, int, int, int) line: 2454	
	Composite(Scrollable).callWindowProc(int, int, int, int) line: 80	
	Composite(Control).WM_WINDOWPOSCHANGED(int, int) line: 4970	
	Composite(Control).windowProc(int, int, int, int) line: 4244	
	Display.windowProc(int, int, int, int) line: 4873	
	OS.SetWindowPos(int, int, int, int, int, int, int) line: not available [native method]	
	Composite(Widget).SetWindowPos(int, int, int, int, int, int, int) line: 1456	
	Composite(Control).setBounds(int, int, int, int, int, boolean) line: 2816	
	Composite.setBounds(int, int, int, int, int, boolean) line: 1018	
	Composite(Control).setBounds(int, int, int, int, int) line: 2777	
	Composite(Control).setBounds(int, int, int, int) line: 2773	
	Composite(Control).setBounds(Rectangle) line: 2840	
	ViewPane(LayoutPart).setBounds(Rectangle) line: 300	
	PresentablePart.setBounds(Rectangle) line: 170	
	PresentablePartFolder.layoutContent() line: 131	
	PresentablePartFolder.access$0(PresentablePartFolder) line: 127	
	PresentablePartFolder$1.controlMoved(ControlEvent) line: 56	
	TypedListener.handleEvent(Event) line: 217	
	EventTable.sendEvent(Event) line: 84	
	Composite(Widget).sendEvent(Event) line: 1053	
	Composite(Widget).sendEvent(int, Event, boolean) line: 1077	
	Composite(Widget).sendEvent(int) line: 1058	
	Composite(Control).WM_MOVE(int, int) line: 4696	
	Composite(Control).windowProc(int, int, int, int) line: 4209	
	Display.windowProc(int, int, int, int) line: 4873	
	OS.DefWindowProcW(int, int, int, int) line: not available [native method]	
	OS.DefWindowProc(int, int, int, int) line: 2454	
	Composite(Scrollable).callWindowProc(int, int, int, int) line: 80	
	Composite(Control).WM_WINDOWPOSCHANGED(int, int) line: 4970	
	Composite(Control).windowProc(int, int, int, int) line: 4244	
	Display.windowProc(int, int, int, int) line: 4886	
	OS.EndDeferWindowPos(int) line: not available [native method]	
	ViewForm(Composite).resizeChildren(boolean, WINDOWPOS[]) line: 948	
	ViewForm(Composite).resizeChildren() line: 914	
	ViewForm(Composite).setResizeChildren(boolean) line: 1138	
	ViewForm(Composite).updateLayout(boolean, boolean) line: 1276	
	ViewForm(Composite).updateLayout(boolean) line: 1261	
	ViewForm(Composite).setLayoutDeferred(boolean) line: 1098	
	PaneFolder.layout(boolean) line: 556	
	DefaultTabFolder.layout(boolean) line: 403	
	PresentablePartFolder.layout(boolean) line: 408	
	PresentablePartFolder.select(IPresentablePart) line: 292	
	LeftToRightTabOrder.select(IPresentablePart) line: 65	
	TabbedStackPresentation.selectPart(IPresentablePart) line: 473	
	ViewStack(PartStack).refreshPresentationSelection() line: 1254	
	ViewStack(PartStack).setSelection(LayoutPart) line: 1207	
	ViewStack(PartStack).showPart(LayoutPart, Object) line: 1606	
	ViewStack(PartStack).replace(LayoutPart, LayoutPart) line: 914	
	PerspectiveHelper.addPart(LayoutPart) line: 400	
	Perspective.removeFastView(IViewReference, boolean) line: 1192	
	Perspective.removeFastView(IViewReference) line: 1167	
	WorkbenchPage.removeFastView(IViewReference) line: 2988	
	FastViewManager.makeFast(IViewReference, boolean, boolean) line: 380	
	FastViewManager.removeViewReference(IViewReference, boolean, boolean) line: 360	
	FastViewManager.restoreToPresentation(String) line: 665	
	ViewStack.setMinimized(boolean) line: 155	
	ViewStack(PartStack).smartUnzoom() line: 1422	
	PartStack$3.runWithException() line: 1478	
	PartStack$3(StartupThreading$StartupRunnable).run() line: 31	
	UISynchronizer(Synchronizer).syncExec(Runnable) line: 179	
	UISynchronizer.syncExec(Runnable) line: 150	
	Display.syncExec(Runnable) line: 4584	
	StartupThreading.runWithoutExceptions(StartupThreading$StartupRunnable) line: 94	
	ViewStack(PartStack).setState(int) line: 1471	
	PartStack$1.setState(int) line: 145	
	TabbedStackPresentation$1.handleEvent(TabFolderEvent) line: 76	
	DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent) line: 269	
	DefaultTabFolder(AbstractTabFolder).fireEvent(int) line: 274	
	DefaultTabFolder(AbstractTabFolder).handleDoubleClick(Point, MouseEvent) line: 353	
	AbstractTabFolder$3.mouseDoubleClick(MouseEvent) line: 89	
	TypedListener.handleEvent(Event) line: 189	
	EventTable.sendEvent(Event) line: 84	
	CTabFolder(Widget).sendEvent(Event) line: 1053	
	Display.runDeferredEvents() line: 4066	
	Display.readAndDispatch() line: 3657	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2640	
	Workbench.runUI() line: 2604	
	Workbench.access$4(Workbench) line: 2438	
	Workbench$7.run() line: 671	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 664	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	IDEApplication.start(IApplicationContext) line: 115	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 369	
	EclipseStarter.run(String[], Runnable) line: 179	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 48	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 600	
	Main.invokeFramework(String[], URL[]) line: 619	
	Main.basicRun(String[]) line: 574	
	Main.run(String[]) line: 1407	
	Main.main(String[]) line: 1383	


Reproducible: Always

Steps to Reproduce:
1. Start a debug session (can be java debug)
2. In the same perspective as the debug view ... maximize the variables view
3. Now restore the variables view and observe that an empty selection event is sent from the debug view
Comment 1 Michael Rennie CLA 2011-05-02 16:47:55 EDT
looks like the breadcrumb is reacting to a context changed event and sending a selection changed event.
Comment 2 Pawel Piech CLA 2012-04-03 14:56:06 EDT
I looked at how to fix this and concluded that it may cause more problems than it solves.  The breadcrumb does not use selection in the same way as the tree control, so it behaves a little differently.  Clients should act on active debug context instead of debug view selection.  

I fixed the two related bugs in CDT so they don't depend on debug view selection.
Comment 3 Alan Boxall CLA 2012-04-04 22:02:34 EDT
I'm ok moving to use debug context instead of selection events.