Bug 466233 - Toolbar items are rendered into a "drop-down" even though there is space for them
Summary: Toolbar items are rendered into a "drop-down" even though there is space for ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.5 RC1   Edit
Assignee: Marc-André Laperle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-03 13:09 EDT by Marc-André Laperle CLA
Modified: 2015-05-12 14:53 EDT (History)
4 users (show)

See Also:
loskutov: review+
Lars.Vogel: review+


Attachments
Sample plugin (2.72 KB, application/x-zip-compressed)
2015-05-03 13:09 EDT, Marc-André Laperle CLA
no flags Details
Drop-down in toolbar screenshot (32.83 KB, image/png)
2015-05-03 13:11 EDT, Marc-André Laperle CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2015-05-03 13:09:59 EDT
Created attachment 253108 [details]
Sample plugin

Using Eclipse 4.5-I20150502-1500

1. Import the attached sample plugin
2. Open the toolbar.target file with the Target Platform Editor. Set as target platform (top-right corner of the editor)
3. Run as Eclipse Application. Make sure the product selected in the launch is org.eclipse.sdk.ide because this affects the initial perspective (Java).

The debug toolbar has a large empty space followed by a drop-down button containing some commands. I will attach a screenshot to show the result.

This only happens the first time, when the welcome screen is shown. To reproduce the issue again, you can edit your launch configuration to have the workspace cleared automatically.
Comment 1 Marc-André Laperle CLA 2015-05-03 13:11:09 EDT
Created attachment 253109 [details]
Drop-down in toolbar screenshot
Comment 2 Marc-André Laperle CLA 2015-05-03 13:14:10 EDT
I should add that switching to the Debug perspective fixes the problem, the toolbar items are drawn properly.
Comment 3 Eclipse Genie CLA 2015-05-03 15:20:31 EDT
New Gerrit change created: https://git.eclipse.org/r/46994
Comment 4 Marc-André Laperle CLA 2015-05-03 15:22:09 EDT
In the sample plugin, there are two commands in the toolbar of interest: "Test command" and Skip breakpoints. Test Command is added to the toolbar first. Then the toolbar and the toolbar's parent are packed in ToolBarManagerRenderer.subscribeTopicUpdateToBeRendered. At that point, the TrimBarLayout has a cache filled with the toolbar's size accounting only for the size of the Test Command. Then the Skip breakpoints is added but the TrimBarLayout's cache is never flushed or refreshed. This is similar to what I mentioned in bug 463245 comment 20. This layout does not adhere to the computeSize/layout methods contract to flush the cache when the flushCache == true. I tried this and it fixes this issue. In bug 463245 comment 20, I mentioned that this broke dragging the toolbars but I do not see any problem on GTK2/GTK3. I will test it on Windows and Mac to make sure.
Comment 5 Andrey Loskutov CLA 2015-05-10 17:26:07 EDT
+1 from me to include in 4.5. I can reproduce the bug on GTK3 only (GTK2 is not affected), the fix makes sense, works on GTK3 and has no visible impact on GTK2. 

@Tom, Lars - can you please review if you have time, we need a second +1?
Comment 6 Lars Vogel CLA 2015-05-11 05:37:03 EDT
(In reply to Andrey Loskutov from comment #5)
> +1 from me to include in 4.5. I can reproduce the bug on GTK3 only (GTK2 is
> not affected), the fix makes sense, works on GTK3 and has no visible impact
> on GTK2. 
> 
> @Tom, Lars - can you please review if you have time, we need a second +1?

I suggested a minor change in the review, but if that is adjusted +1 from me.
Comment 7 Lars Vogel CLA 2015-05-12 04:25:27 EDT
(In reply to Andrey Loskutov from comment #5)
> @Tom, Lars - can you please review if you have time, we need a second +1?

Done, feel free to merge.
Comment 9 Andrey Loskutov CLA 2015-05-12 14:53:26 EDT
Thanks Marc-Andre.