| Summary: | [EditorMgmt] Hitting close X should not send partActivated event | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Sebastian Dietrich <Sebastian.Dietrich> |
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | daniel.kullmann, daniel_megert, gunnar, pwebster, raj.alagumalai, remy.suen |
| Version: | 3.4.1 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
|
Description
Sebastian Dietrich
This happens with other navigation views as well. The problem is that a partActivated is sent when closing the editor. This seems odd and not also not optimal regarding performance. Note that this only seems to happen when there is only a single file open. When there is more than one file open it chooses another based on the activation history. Dani, I think that its the Explorer that's being activated (since there are no currently open editors). Could you verify this ? If this is the cause of the partActivated event then maybe we should change the defect's title since in that case the part activation (of the explorer) is necessary. Sorry Eric you are wrong: clicking on the X in the tab always activates the editor and sends an IPartListener2.partActivated(IWorkbenchPartReference) event for that editor. Dani, that's why I asked...;-). I'm still confused though, I've placed breakpoints in: PartListenerList2 [line: 65] - firePartActivated(IWorkbenchPartReference) WorkbenchPage [line: 620] - activatePart(IWorkbenchPart) and neither BP gets triggered when I close a non-active editor using "X", what am I missing? >Dani, that's why I asked...;-).
Sorry :-)
I guess I was also not 100% clear in my answer: you are right that only closing the last editor exposes the issue that hitting the [x] on the non-active editor tab activates the editor.
I've set the BP at same locations too and they get hit (and the part that gets activated is the CompilationUnitEditor that gets closed). I see two reasons why you don't see it:
1) we have different settings in our target workspace (mine is out of the box)
2) you are not on WindowsXP (though I see the same on Linux-GTK)
Here's the stack when the BP is hit on WindowsXP:
Thread [main] (Suspended (breakpoint at line 620 in WorkbenchPage))
WorkbenchPage.activatePart(IWorkbenchPart) line: 620
WorkbenchPage.setActivePart(IWorkbenchPart) line: 3518
WorkbenchPage.requestActivation(IWorkbenchPart) line: 3065
EditorPane(PartPane).requestActivation() line: 279
EditorPane.requestActivation() line: 98
PresentablePart.setFocus() line: 192
TabbedStackPresentation$1.handleEvent(TabFolderEvent) line: 94
DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent) line: 270
DefaultTabFolder(AbstractTabFolder).fireEvent(int) line: 275
DefaultTabFolder(AbstractTabFolder).handleMouseDown(Point, MouseEvent) line: 345
AbstractTabFolder$3.mouseDown(MouseEvent) line: 79
TypedListener.handleEvent(Event) line: 179
EventTable.sendEvent(Event) line: 84
CTabFolder(Widget).sendEvent(Event) line: 1003
Display.runDeferredEvents() line: 3875
Display.readAndDispatch() line: 3470
Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2388
Workbench.runUI() line: 2352
Workbench.access$4(Workbench) line: 2204
Workbench$5.run() line: 499
Realm.runWithDefault(Realm, Runnable) line: 333
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 492
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149
IDEApplication.start(IApplicationContext) line: 113
EclipseAppHandle.run(Object) line: 194
EclipseAppLauncher.runApplication(Object) line: 110
EclipseAppLauncher.start(Object) line: 79
EclipseStarter.run(Object) line: 368
EclipseStarter.run(String[], Runnable) line: 179
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
Main.invokeFramework(String[], URL[]) line: 556
Main.basicRun(String[]) line: 511
Main.run(String[]) line: 1270
Main.main(String[]) line: 1246
*** Bug 261725 has been marked as a duplicate of this bug. *** *** Bug 264166 has been marked as a duplicate of this bug. *** (In reply to comment #5) > Thread [main] (Suspended (breakpoint at line 620 in WorkbenchPage)) > WorkbenchPage.activatePart(IWorkbenchPart) line: 620 > WorkbenchPage.setActivePart(IWorkbenchPart) line: 3518 > WorkbenchPage.requestActivation(IWorkbenchPart) line: 3065 > EditorPane(PartPane).requestActivation() line: 279 > EditorPane.requestActivation() line: 98 > PresentablePart.setFocus() line: 192 > TabbedStackPresentation$1.handleEvent(TabFolderEvent) line: 94 > DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent) line: 270 > DefaultTabFolder(AbstractTabFolder).fireEvent(int) line: 275 > DefaultTabFolder(AbstractTabFolder).handleMouseDown(Point, MouseEvent) > line: 345 Since the trace leads down (or up) to handleMouseDown(Point, MouseEvent), I suspect this may be a duplicate of bug 258511. Dani? (In reply to comment #8) > Since the trace leads down (or up) to handleMouseDown(Point, MouseEvent), I > suspect this may be a duplicate of bug 258511. Dani? But I guess since bug 258511 is talking about the middle mouse button the patch on that bug won't actually solve the problem described on this bug... :o >Since the trace leads down (or up) to handleMouseDown(Point, MouseEvent), I >suspect this may be a duplicate of bug 258511. Dani? Could be. This bug here is about single click on the [x] but it's similar the bug you mention and also similar to bug 60833: basically we should not activate the editor no matter what's done on/with the editor tab until something is done that really requires this. Remy is now responsible for watching the [EditorMgmt] component area. *** Bug 334774 has been marked as a duplicate of this bug. *** 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. |