This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 308700 - Closing a tab of a non-active stack activates it
Summary: Closing a tab of a non-active stack activates it
Status: RESOLVED WORKSFORME
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard: stalebug
Keywords:
: 319799 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-09 16:17 EDT by Remy Suen CLA
Modified: 2019-06-05 07:42 EDT (History)
2 users (show)

See Also:


Attachments
StackRenderer patch v1 (2.23 KB, patch)
2010-04-19 09:34 EDT, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-04-09 16:17:25 EDT
1. Open a file. The editor is active.
2. Close the 'Problems' view.
3. The bottom stack is now active (as observed by the colouring).
4. If you move try to type stuff, the text goes in the editor though.

org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.activateStack(StackRenderer.java:94)
	at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.access$4(StackRenderer.java:93)
	at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer$5.widgetSelected(StackRenderer.java:433)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1050)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1074)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1059)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:773)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2722)
	at org.eclipse.swt.custom.CTabFolder.destroyItem(CTabFolder.java:500)
	at org.eclipse.swt.custom.CTabItem.dispose(CTabItem.java:125)
	at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.hideChild(StackRenderer.java:381)
	at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.removeGui(PartRenderingEngine.java:400)
	at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine$1.handleEvent(PartRenderingEngine.java:95)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:41)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:188)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:198)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:139)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:76)
	at org.eclipse.e4.workbench.ui.internal.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.e4.ui.model.application.impl.PartImpl.setToBeRendered(PartImpl.java:508)
	at org.eclipse.e4.workbench.ui.internal.PartServiceImpl.hidePart(PartServiceImpl.java:517)
	at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer$6.close(StackRenderer.java:447)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1578)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:261)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1050)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4039)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3630)
	at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine$5.run(PartRenderingEngine.java:553)
Comment 1 Remy Suen CLA 2010-04-09 16:57:37 EDT
(In reply to comment #0)
> 4. If you move try to type stuff, the text goes in the editor though.

This is likely because we don't actually invoke setFocus(). See bug 308679.
Comment 2 Remy Suen CLA 2010-04-11 17:49:25 EDT
Same thing happens if you have two editors open and a view active and you then invoke Ctrl+W to close the active editor. The editor stack will now become active.
Comment 3 Remy Suen CLA 2010-04-19 09:34:24 EDT
Created attachment 165278 [details]
StackRenderer patch v1

This is an illustrative patch to only activate the part if it's actually in the same stack that the currently active part is. I'm not entirely convinced that this is the right way to go though.
Comment 4 Eric Moffatt CLA 2010-04-20 13:32:28 EDT
Remy, why don't we start to implement the 3.x activation history logic (which is what we should have anyways). Keep track of the activations and when the active part is closed revert the activation to the most recently active part that is still in the UI.

I'm not sure but I think that the legacy handling also supports view/editor specific handling (i.e. if it was an editor that closed then it tries to maintain the activation within the editors).
Comment 5 Eric Moffatt CLA 2010-06-21 10:34:13 EDT
Remy, what's the state of the activation history ?
Comment 6 Remy Suen CLA 2010-06-21 10:35:24 EDT
(In reply to comment #5)
> Remy, what's the state of the activation history ?

Right now, we got nothin'.
Comment 7 Remy Suen CLA 2010-07-14 20:44:59 EDT
This is still a problem. Just open two editors, activate a view, and then hit Ctrl+W. The editor stack suddenly becomes the active stack.
Comment 8 Remy Suen CLA 2010-07-14 20:48:52 EDT
I'm wondering if we can remove the stack activation request in the widget selection listener. I'd expect an activation event to be sent to the CTabFolder if an item was actually clicked on by the user, so can that line (420) be removed?
Comment 9 Susan McCourt CLA 2010-07-14 22:54:05 EDT
This reminds me of bug 319799, where a widget selection event is also causing part stack activation and focus change...not sure it's the *same* bug, but similar.
Comment 10 Remy Suen CLA 2010-07-17 07:04:22 EDT
*** Bug 319799 has been marked as a duplicate of this bug. ***
Comment 11 Thomas Schindl CLA 2010-07-17 14:12:55 EDT
In RC2 I see the opposite effect which is also not really nice when selecting a Tab with the mouse the editor is not getting focus which means a second click is needed and this kills productivity by 10 because e.g. the last cursor position is not restored.

And for the record navigating the TabFolder with the keyboard IS not supported in 3.x!
Comment 12 Eclipse Genie CLA 2019-02-18 16:09:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 13 Lars Vogel CLA 2019-06-05 07:42:28 EDT
This is a mass change to close all e4 bugs marked with "stalebug" whiteboard.

If this bug is still valid, please reopen and remove the "stalebug" keyword.