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

Bug 493335

Summary: [WorkingSets] Setting window working set affects all windows
Product: [Eclipse Project] Platform Reporter: Brian de Alwis <bsd>
Component: UIAssignee: Brian de Alwis <bsd>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Lars.Vogel, psuzzi
Version: 4.6Flags: psuzzi: review+
Lars.Vogel: review+
Target Milestone: 4.6 RC2   
Hardware: PC   
OS: Mac OS X   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=412970
https://git.eclipse.org/r/72464
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=78b6ea727ada099e2d46d30ae9ff34f6528f8a19
Whiteboard:

Description Brian de Alwis CLA 2016-05-10 09:34:53 EDT
BuildId: 4.6.0.I20160428-0800

Steps to repeat:
1. Open two windows
2. You may need to use Window > Perspective > Customize Perspective > Action Set Availability and enable Window Working Set
3. Use the Window Working Set to create two different working sets.
4. Select one working set.  See the other window react.
Comment 1 Brian de Alwis CLA 2016-05-10 22:24:16 EDT
The fix for bug 412970 does not properly handle multiple windows.  The change in WindowPage (reformatted):

+   if (aggregateWorkingSetId == null) {
+      aggregateWorkingSet = findAggregateWorkingSet(workingSetManager);
+      aggregateWorkingSetId = aggregateWorkingSet == null
+            ? getDefaultAggregateWorkingSetId()
+            : aggregateWorkingSet.getName();

means that a new windows (which has aggregateWorkingSetId == null) will share the same aggregate working set.  There must be an aggregateWorkingSet per window.
Comment 2 Eclipse Genie CLA 2016-05-10 22:39:08 EDT
New Gerrit change created: https://git.eclipse.org/r/72464
Comment 3 Brian de Alwis CLA 2016-05-11 12:22:41 EDT
To see the problem, look at the 'aggregateWorkingSetId' key for the windows in your saved workbench layout.  You'll see all windows reference the same working set (effectively a workbench working set).  Although that could be desirable, that's not the intention of the Window Working Set.

It does mean that existing workspaces will need to close and reopen their windows.

```
$ grep aggregateWorkingSetId ../ws/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi 
    <persistedState key="aggregateWorkingSetId" value="Aggregate for window 1458700436581"/>
    <persistedState key="aggregateWorkingSetId" value="Aggregate for window 1458700436581"/>
    <persistedState key="aggregateWorkingSetId" value="Aggregate for window 1458700436581"/>
```
Comment 4 Patrik Suzzi CLA 2016-05-11 13:23:59 EDT
I tested your fix with a new workspace and it works fine.
Comment 5 Brian de Alwis CLA 2016-05-17 14:48:21 EDT
Resolved for RC2.
Comment 7 Brian de Alwis CLA 2016-05-20 10:29:00 EDT
Verified in 4.6.0.I20160519-1730.  This fix will only apply to newly created windows — existing windows to this point will continue to share the same working set.