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

Bug 357859

Summary: Resetting a saved perspective destroys its detached windows
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Dean Roberts <dean.t.roberts>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: david_williams, dean.t.roberts, emoffatt
Version: 4.2   
Target Milestone: 4.2 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Cause detached windows to surivie a perspective reset
none
Fix attempt 2
none
Attempt 3 none

Description Remy Suen CLA 2011-09-15 14:47:28 EDT
I20110914-0200

1. Detach a view.
2. Save the perspective.
3. Window > Reset Perspective
4. Now the detached view is gone.
5. Window > Close Perspective
6. Reopen the saved perspective.
7. The detached window comes back.
Comment 1 Dean Roberts CLA 2011-09-19 09:53:54 EDT
Just to be explicit, the problem here is that in step 4, the detach window closes.  It should not, since the detached window is the base state for the saved perspective.

Confirmed this behaviour in 3.8
Comment 2 Dean Roberts CLA 2011-09-19 10:40:01 EDT
Created attachment 203598 [details]
Cause detached windows to surivie a perspective reset
Comment 3 Remy Suen CLA 2011-09-23 09:52:10 EDT
Comment on attachment 203598 [details]
Cause detached windows to surivie a perspective reset

The patch saves the detached window, that's good.

The detached window's parts are recreated, not so good.

If you detach the 'Package Explorer' and expand some items and reset, you will see that your expanded items have been collapsed.
Comment 4 Dean Roberts CLA 2011-09-23 14:25:18 EDT
Created attachment 203927 [details]
Fix attempt 2

This patch should fix the problem with detached windows going away when a perspective reset, without recreating the mparts (ie, trees and such will not collapse on reset)
Comment 5 Remy Suen CLA 2011-09-26 12:35:25 EDT
Comment on attachment 203927 [details]
Fix attempt 2

(In reply to comment #4)
> Created attachment 203927 [details]
> Fix attempt 2

1. Detach a view.
2. Detach a view in another window (so you now have two detached windows).
3. Window > Save Perspective As... > Give it a name > OK
4. Window > Reset Perspective... > OK
5. An error is thrown.

At this point Eclipse is in a bad state. Try to close both of the views in the two detached windows. One of them will fail to close.
Comment 6 Dean Roberts CLA 2011-09-29 13:47:34 EDT
It looks like the test case shown in comment #5 is using saved perspectives and multiple windows.

I think we need to have the fix for bug 357853 in place before we can tell if the problem described in comment #5 is a result of the patch on this defect, or a manifestation of multi window save perspective issues.

I believe Eric is working on a fix for this.
Comment 7 Dean Roberts CLA 2011-09-29 14:11:17 EDT
Just talked to Remy.  Step 2 just means detach a 2nd view.  Not that you have multiple workbench windows open.

Starting to look at it.
Comment 8 Dean Roberts CLA 2011-09-30 09:30:58 EDT
Created attachment 204378 [details]
Attempt 3

Note that while testing this patch you will likely run into problems caused by bug 359556 since you will be running some of the same scenerios.
Comment 9 Remy Suen CLA 2011-09-30 10:36:41 EDT
(In reply to comment #8)
> Created attachment 204378 [details]
> Attempt 3

Patch released to R4_development. Thanks, Dean.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=0ef718068648dbf2d469fc333eba58e6e6aad22e
Comment 10 Remy Suen CLA 2011-09-30 10:37:03 EDT
Whoops.
Comment 11 Dean Roberts CLA 2011-10-26 13:55:58 EDT
Verified on I20111014-1625