Community
Participate
Working Groups
Created attachment 228018 [details] Screenshot I20130306-0045 Some views have duplicate contributions in the view menu and toolbar, see attachment. The Git Repositories view also has duplicated view menu items. Context menus look OK. I can't tell exactly what made this appear, but I see it in different workspaces on Mac and Windows, since about 2 weeks. Maybe it only shows up after a workspace crashed. I could not reproduce in a fresh workspace, but the problem is persisted when I restart the workspace. When I closed the Git Repositories view in all perspectives and then reopened the view, the duplications in the toolbar were gone, but the view menu was still cluttered. And after a restart, the duplications in the toolbar were back as well.
Markus, could you please attach your .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi ? PW
Created attachment 228019 [details] workbench.xmi
*** Bug 402011 has been marked as a duplicate of this bug. ***
A quick look at the XMI shows that there are three instances of the various TB items under <toolbar xmi:id="_0cfN_oZ-EeKaSbYBTHyP9w" elementId="org.eclipse.egit.ui.RepositoriesView" visible="false"> If I run an inner using Markus' XMI file I see the duplicate entries... While this is undoubtedly what's causing the issue I'm still unsuccessful in being able to reproduce this state.
(In reply to comment #4) > While this is undoubtedly what's causing the issue I'm still unsuccessful in > being able to reproduce this state. I think in my case it had something to do with Eclipse crashes - after a crash the number of duplicated items increased (see attachments in bug 402011).
I don't see why this information should be persisted at all. A view implementation has to create these contributions when the view is created, so it's not necessary to persist anything. If you stop persisting state that is not necessary, then you also don't have to deal with issues that only arise in exceptional circumstances like a crash.
*** Bug 405488 has been marked as a duplicate of this bug. ***
*** Bug 403900 has been marked as a duplicate of this bug. ***
I was testing a hack that checked for duplicates when the contributions are loaded, and it worked at removing the dupes, but any contribution that had duplicates appeared in the wrong order. For example in problems view the Configure Contents... and Configure Columns... items appeared at the top of the menu instead of the end like normal. Chatting with Paul, there could be an issue in org.eclipse.ui.internal.Workbench.cleanUpCopy(MApplication) where the contributions are not being cleaned up properly. Another place to check could be org.eclipse.ui.internal.e4.compatibility.CompatibilityView.disposeSite(PartSite)
Finally nailed down some steps: 1. run eclipsec from a command prompt (using default or new workspace) 2. open the problems view, open its view menu 3. close the view and reopen it 4. close Eclipse from the command line using Ctrl+C (to simulate a crash) 5. restart After the restart check the problems view menu and there should now be duplicate values. I will attach my XMI file from these steps.
Created attachment 230141 [details] workbench.xmi with dupes
I pushed changes to: https://git.eclipse.org/r/12253 Chatting with Paul, the solution is to clear out all of the model-created items when the compatibility view is first created. The fix removes all the duplicates from menus and toolbars and did not require additional changes to the persistence code as a call to clear out all of the menu contributions is already done.
(In reply to comment #12) > I pushed changes to: https://git.eclipse.org/r/12253 > Thanks Mike, released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=1a4ab8fb2c03f323d33fe6e9efa2b32c79a7e483 Also added clean up code to the write-out: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=771ed1178df0cde8939386655c91201c2356d39b PW
.
I wanted to verify the fix. So, I first tried the steps from comment 10 against N20130425-2000-win32, but for me those steps did not surface the bug.
Verified in I20130430-0031. I also couldn't reproduce comment 10, but I don't see any duplications any more in the workspaces where they used to show up.
I've also verified it's cleaned up my duplicates in my Git Repositories view. PW
*** Bug 403605 has been marked as a duplicate of this bug. ***
I am seeing this bug again in 4.4M5! I have a duplicated toolbar contribution inside the main toolbar and duplicated contributions to the right trim bar. I don't have these in Kepler (4.3.1).
(In reply to SlowStrider Mising name from comment #19) > I am seeing this bug again in 4.4M5! > > I have a duplicated toolbar contribution inside the main toolbar and > duplicated contributions to the right trim bar. I don't have these in Kepler > (4.3.1). Please open a new bug with steps to reproduce.
@Dani Megert I investigated the cause. It only happens in a combination of circumstances one of which is a problem in my own code and two of which are related to bugs that have already been reported. I added comments there. - root cause is that in Luna 4.4M5 WorkbenchWindowControlContribution.createControl is called twice, the first time with a null value for WorkbenchWindowControlContribution.getWorkbenchWindow() while it is still being created. This is related to what has been reported here https://bugs.eclipse.org/bugs/show_bug.cgi?id=427452 - second cause is that my createControl(Composite parent) method was calling PlatformUI.getWorkbench().getActiveWorkbenchWindow() instead of WorkbenchWindowControlContribution.getWorkbenchWindow(). This resulted in an attempt to create a new Workbench Window, which recursively calls createControl() again. This has already been reported here https://bugs.eclipse.org/bugs/show_bug.cgi?id=366708 I adjusted my code to use WorkbenchWindowControlContribution.getWorkbenchWindow() instead in my createControl() method and handle the null value on the first call.
Created attachment 271098 [details] screenshot Facing this issue in 4.7.1
I am facing the same issue with 4.7.0 and do not have Darkest Dark Theme installed. But what I have noticed is that some icons get duplicated one more time when I change the laptop from place (e.g. bring laptop from work to home, viceversa) so it could be related to something that changes with the place as well, like IP (don't think so), displays connected (amount/models), ...