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

Bug 347205

Summary: Window tool bar separators starts growing separators
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: VERIFIED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: major    
Priority: P3 CC: emoffatt, gheorghe, pwebster
Version: 1.0   
Target Milestone: 4.1 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screenshot depicting the state in question.
none
Clean up TB life-cycle none

Description Remy Suen CLA 2011-05-25 14:04:00 EDT
Created attachment 196584 [details]
Screenshot depicting the state in question.

I20110524-2200

I'm now at a point where my perspective switcher is on the next line.
Comment 1 Remy Suen CLA 2011-05-25 15:06:25 EDT
1. Select a local unversioned file.
2. Alt+Shift+W > History
3. Select an entry > Context menu > Compare Current with Local
4. Ctrl+W
5. Notice that there is now a trailing separator in your workbench window's tool bar.
6. Repeat steps 3 and 4 to spawn N number of separators.
Comment 2 Eric Moffatt CLA 2011-05-25 16:06:13 EDT
This is in the CoolBarToTrimManager I think...

If we add code to set the TBR to false before doing the 'remove' in CBTTM's remove then we no longer see the effect. I've taken a look at the life-cycle though and there is a bit more work that need to be done; the override of 'disposeWidget' sets the outer Composite to 'visible(false)' so it's never actually disposed but the addition of the new MToolBar for the same managed TB re-creates the 'intermediate' so we're still leaking SWT widgets...

Two choices here I think:

1) Change CBTTM to only create the MToolBar once and then manage its state using the model's visible flag. Then we could likely remove the 'disposeWidget' override altogether since the only time we'd ever set the TBR to false would be if the TBManager goes away (or its tb gets disposed).

2) Add a 'setTBR(false)' just before removing the MTB and re-work the disposeWidget code to stash the managed TB in limbo but allowing the rest of the 'intermediate' do actually be disposed.
Comment 3 Eric Moffatt CLA 2011-05-26 13:04:18 EDT
Created attachment 196679 [details]
Clean up TB life-cycle
Comment 4 Eric Moffatt CLA 2011-05-26 13:10:17 EDT
Committed in >20110526. Applied the patch.
Comment 5 Eric Moffatt CLA 2011-06-06 10:50:30 EDT
Verified in I20110604-2201