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

Bug 432686

Summary: [Trim] show toolbar does not take effect if workspace is started with hidden toolbar
Product: [Eclipse Project] Platform Reporter: Max Rydahl Andersen <manderse>
Component: UIAssignee: Wojciech Sudol <sudol.wojciech>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel.rolka, daniel_megert, Lars.Vogel, odrotbohm, pwebster, sudol.wojciech
Version: 4.4Flags: daniel_megert: pmc_approved+
Target Milestone: 4.4.2   
Hardware: PC   
OS: All   
Whiteboard:

Description Max Rydahl Andersen CLA 2014-04-13 02:57:00 EDT
with nightly build from 2014-04-13 I hid the toolbar and restarted.

now when trying to show the toolbar it has no effect. Tried multiple times, same result - toolbar stays hidden *until* I restart.
Comment 1 Max Rydahl Andersen CLA 2014-04-13 02:59:20 EDT
verified three times and same pattern emerges. Hide toolbar and restarted - now I cannot show the toolbar without a restart.
Comment 2 Wojciech Sudol CLA 2014-04-14 00:55:40 EDT
Reproduced in Windows 7 with N20140410-2000.
Comment 3 Lars Vogel CLA 2014-04-24 15:27:33 EDT
Ah sorry, I assume this was my change to hide toolbar entries. Looks like this is valid for the whole hidding of the toolbar which I have not touched.

Wojciech, in case you looking into this, you might want to have a look at Bug 426535, which implements this via the a model tag HIDDEN_EXPLICITLY for toolbar entries.
Comment 4 Wojciech Sudol CLA 2014-05-05 06:19:57 EDT
I think we should fix this in Luna.
Also, when I was testing the M7 build, a hidden toolbar unexpectedly became visible after switching some views. Unfortunately I cannot find a reliable scenario to reproduce this issue.
Comment 5 Lars Vogel CLA 2014-05-05 08:03:59 EDT
(In reply to Wojciech Sudol from comment #4)
> I think we should fix this in Luna.

+1
Comment 6 Dani Megert CLA 2014-05-06 06:31:53 EDT

*** This bug has been marked as a duplicate of bug 433979 ***
Comment 7 Lars Vogel CLA 2014-05-06 07:23:22 EDT
That is present with or without the development of Bug 433979
Comment 8 Lars Vogel CLA 2014-05-06 08:26:16 EDT
(In reply to Lars Vogel from comment #7)
> That is present with or without the development of Bug 433979

In my test I reverted the "Hide toolbar" changes and the issue of this bug was still present. So this Bug seems to me as if it independent of Bug 433979.
Comment 9 Oliver Drotbohm CLA 2014-07-16 07:27:54 EDT
I also still see issues with toolbar hiding on Luna. Lars asked me to try to reproduce it so I waited for the next Eclipse crash (yeah, that happens sometimes :) and took a quick screencast of the behavior. So here it is:

https://dl.dropboxusercontent.com/u/25310722/toolbarbug.mov

Here's what's happening:

1. When Eclipse crashes and I restart it sometimes (not always) shows up with a visible toolbar (as you can see in the video).
2. Note, that the menu still shows "Show toolbar" although it's already shown.
3. Click "Show toolbar", nothing changes except the menu item now correctly shows "Hide toolbar".
4. Click "Hide toolbar" -> Toolbar disappears.
5. Click around in the UI (some Editors) -> Toolbar reappears but the menu item is still in "Show toolbar" mode.
Comment 10 Wojciech Sudol CLA 2015-01-12 07:59:44 EST
This bug is closely related to two other bugs: bug 416746 and bug 411821. This issue has been introduced by a fix for bug 416746. A better fix (that doesn't introduce this issue) is presented here: https://git.eclipse.org/r/#/c/39384/. Unfortunately, it cannot be applied, because a fix for bug 411821 depends on the initial, merged patch (for bug 416746). I think, that in this situation the best option is to apply this patch: https://git.eclipse.org/r/#/c/39379/.
This issue occurs, because when starting an RCP application with hidden toolbar, the toolbar's widget is created outside TrimmedPartLayout, so the layout has no reference to the widget, thus later cannot render the toolbar correctly.
In the patch, directly before first rendering I temporarily make the trim visible to correctly initialize the TrimmedPartLayout instance.
Comment 11 Paul Webster CLA 2015-01-14 13:32:02 EST
Released http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b3eab327711f465853b9e82678f362557572cfdf into master.

It just has to be backported.

Thanks Wojtek :-)

PW
Comment 12 Wojciech Sudol CLA 2015-01-15 08:52:48 EST
Review link for R4_4_maintenance: https://git.eclipse.org/r/39662.
Comment 13 Dani Megert CLA 2015-01-19 08:31:48 EST
(In reply to Wojciech Sudol from comment #12)
> Review link for R4_4_maintenance: https://git.eclipse.org/r/39662.

Submitted with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=256ceb775f6f237da077cb70db66344e91eae042

I've updated the copyright date afterwards (also in master).
Comment 14 Wojciech Sudol CLA 2015-01-28 03:43:41 EST
Verified in 4.5 I20150126-2000.