Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320306 - [UI] Close / Reset Perspective with multiple perspectives closes all perspectives
Summary: [UI] Close / Reset Perspective with multiple perspectives closes all perspect...
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.0 RC3   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-19 14:15 EDT by Eric Moffatt CLA
Modified: 2010-07-27 14:56 EDT (History)
2 users (show)

See Also:
remy.suen: review+
bokowski: review+


Attachments
Use the MPerspective stack's list of children rather than an internal collection (4.41 KB, patch)
2010-07-19 14:33 EDT, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Moffatt CLA 2010-07-19 14:15:01 EDT
The problem is that WorkbenchPage#closePerspective first checks to see if the 'openedPerspectives' collection has a single element and, if so, calls 'closeAllPerspectives'. It appears that this field is not correctly set on a restart (it only contains the previously active perspective even though I had 4 perspectives open).

There is also a secondary issue with closing a perspective that has never been rendered, we get an NPE in the PerspectiveSwitcher's 'closePerspective' call while trying to retrieve its context.
Comment 1 Eric Moffatt CLA 2010-07-19 14:33:27 EDT
Created attachment 174657 [details]
Use the MPerspective stack's list of children rather than an internal collection


Also safes up the Perspective switcher by using the perspective's containing window's context to avoid cases where the perspective itself hasn't been rendered (so its context == null).
Comment 2 Susan McCourt CLA 2010-07-20 11:48:15 EDT
Eric, please also see bug 320320.  Is this the same thing?  I know I was resetting a perspective with multiple perspectives open.
Comment 3 Remy Suen CLA 2010-07-20 12:49:56 EDT
(In reply to comment #1)
> Created an attachment (id=174657) [details]
> Use the MPerspective stack's list of children rather than an internal
> collection

This patch looks safe to me, +1 for RC3.
Comment 4 Boris Bokowski CLA 2010-07-20 15:04:20 EDT
Patch looks good.
Comment 5 Eric Moffatt CLA 2010-07-20 15:49:14 EDT
Committed in >20100720. Applied the patch (after merging in a change for bug 320327).
Comment 6 Eric Moffatt CLA 2010-07-27 14:56:09 EDT
Verified on XP in I20100726-2152.