Bug 494789

Summary: org.eclipse.ui.trim.command2 failing to display on right side during first startup
Product: [Eclipse Project] Platform Reporter: Bo Berney <bob816804>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: bob816804, daniel_megert, loskutov, narayana.nekkanti
Version: 4.5.2Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/142107
https://bugs.eclipse.org/bugs/show_bug.cgi?id=528890
https://git.eclipse.org/r/143871
Whiteboard:
Attachments:
Description Flags
toolbar test example none

Description Bo Berney CLA 2016-05-27 16:13:38 EDT
Created attachment 262086 [details]
toolbar test example

The following issue is occurring when using e3 compatibility mode in Eclipse 4.5.2 x64, Java 8 x64, and Windows 7.

When starting an RCP application with a brand new runtime workspace, the org.eclipse.ui.trim.command2 toolbar location displays the contribution on the left side of the main toolbar (to the right of the other contributions).

If I close, then re-open the application, then the contribution is correctly displayed on the right side of the main toolbar.

Attached are a couple snapshots and a simple test driver that displays a red X command contribution. The first run will display the "X" with the contributions on left side of main toolbar, the second run will display the red "X" on the far right of the main toolbar.
Comment 1 Eclipse Genie CLA 2019-05-14 03:19:28 EDT
New Gerrit change created: https://git.eclipse.org/r/142107
Comment 2 Lakshminarayana CLA 2019-05-14 03:20:39 EDT
An applied similar solution like Bug 528890. 
https://git.eclipse.org/r/142107

The basic trimbar controls are being created after the extension contributors are added. So, added in default e4 template to create earlier than creating programmatically in this method.
org.eclipse.ui.internal.WorkbenchWindow.populateTopTrimContributions()

I feel it's the safest solution. If we really want to do programmatically, We need to fix it here by reordering the toolbar contributions after a new one added.
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.fixZOrder(MUIElement) Line 428 to 440
Comment 3 Eclipse Genie CLA 2019-06-12 13:21:47 EDT
New Gerrit change created: https://git.eclipse.org/r/143871
Comment 4 Lakshminarayana CLA 2019-06-12 13:34:19 EDT
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/143871

the other change as per the comment
https://bugs.eclipse.org/bugs/show_bug.cgi?id=528890#c27
Comment 5 Dani Megert CLA 2019-12-05 05:03:19 EST
Andrey, can you do the review for 4.15?
Comment 6 Andrey Loskutov CLA 2019-12-06 07:24:50 EST
(In reply to Dani Megert from comment #5)
> Andrey, can you do the review for 4.15?

Thanks for reminder, I forgot this one.
Comment 7 Andrey Loskutov CLA 2021-12-10 08:52:19 EST
I have no time to reproduce & review the patch https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/143871/, so re-assigning to default.

I hope someone can step in.