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

Bug 318363

Summary: [UI] Closing Perspectives changes others
Product: [Eclipse Project] e4 Reporter: Eric Moffatt <emoffatt>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ob1.eclipse, remy.suen
Version: unspecified   
Target Milestone: 1.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to have the perspective switcher use the WorkbenchPage to close
none
Patch for the injection problem
none
Patch that allows perspectives to be closed/reset none

Description Eric Moffatt CLA 2010-06-29 13:53:38 EDT
If you open the Debug perspective and then close it the Package Explorer disappears.

Root cause was that I opened the second perspective using the perspective switcher which performed the operation 'locally' rather than going through the WorkbenchPage#setPerspective code. This meant that the 'openPerspectives' list wasn't updated which meant that the 'closePerspective' call delegated to 'closeAllPerspectives' since it thought there was only one open.
Comment 1 Eric Moffatt CLA 2010-06-29 13:54:59 EDT
Created attachment 173028 [details]
Patch to have the perspective switcher use the WorkbenchPage to close
Comment 2 Eric Moffatt CLA 2010-06-29 13:55:44 EDT
Oleg, to get the NPE start with a clean WS, open the Debug perspective and then close it.
Comment 3 Oleg Besedin CLA 2010-06-29 14:15:56 EDT
Created attachment 173031 [details]
Patch for the injection problem

The patch limits the listeners receiving UNINJECT event to the listeners created from injection, skipping pure #runAndTrack entries.

(After looking at the code, the code doing uninjection processing needs a cleanup. I'll open a separate bug for that, but it is likely to be done after 4.0, unless there turns out to be more issues in it.)
Comment 4 Eric Moffatt CLA 2010-06-29 15:17:24 EDT
Created attachment 173036 [details]
Patch that allows perspectives to be closed/reset
Comment 5 Eric Moffatt CLA 2010-06-29 15:26:00 EDT
Committed in >20100629. Applied the patch (without the changes to the PRE which were checked in under bug 317591).