Fix view transport across perspectives when moved to editor area#3778
Fix view transport across perspectives when moved to editor area#3778fedejeanne wants to merge 2 commits intoeclipse-platform:masterfrom
Conversation
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
There was a problem hiding this comment.
Pull request overview
This PR fixes Eclipse workbench behavior where non-editor views dragged into the editor area (“shared area”) become incorrectly visible across perspectives, and ensures perspective resets don’t remove editor-area view placements belonging to other perspectives.
Changes:
- Tag non-editor views dropped into the shared/editor area with an “owner perspective id” persisted-state key during stack DnD.
- On perspective switch, render only shared-area view placeholders/parts owned by the active perspective.
- During perspective reset, preserve shared-area placeholders owned by other perspectives.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkbenchPage.java | Applies owner-based render scoping on perspective switches and updates container render state accordingly. |
| bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java | Preserves shared-area placeholders owned by other perspectives during perspective reset. |
| bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF | Bundle version bump for the workbench model service change. |
| bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/StackDropAgent.java | Tags moved non-editor stack elements with the owning perspective id when dropped into the shared/editor area. |
| bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF | Bundle version bump for the SWT DnD addon change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private void updatePerspectiveScopedSharedViews(MPerspective activePerspective) { | ||
| String activePerspectiveId = activePerspective == null ? null : activePerspective.getElementId(); | ||
|
|
||
| List<MPlaceholder> sharedPlaceholders = modelService.findElements(window, null, MPlaceholder.class, null, | ||
| EModelService.OUTSIDE_PERSPECTIVE | EModelService.IN_SHARED_AREA); | ||
| for (MPlaceholder placeholder : sharedPlaceholders) { | ||
| String ownerPerspectiveId = placeholder.getPersistedState().get(PERSPECTIVE_SCOPED_OWNER_ID); | ||
| if (ownerPerspectiveId == null) { | ||
| continue; | ||
| } | ||
| boolean shouldRender = ownerPerspectiveId.equals(activePerspectiveId); | ||
| placeholder.setToBeRendered(shouldRender); | ||
| updateContainerVisibility(placeholder.getParent()); | ||
| } | ||
|
|
||
| List<MPart> sharedParts = modelService.findElements(window, null, MPart.class, null, | ||
| EModelService.OUTSIDE_PERSPECTIVE | EModelService.IN_SHARED_AREA); | ||
| for (MPart part : sharedParts) { | ||
| if (part.getCurSharedRef() != null) { | ||
| continue; | ||
| } | ||
| String ownerPerspectiveId = part.getPersistedState().get(PERSPECTIVE_SCOPED_OWNER_ID); | ||
| if (ownerPerspectiveId == null) { | ||
| continue; | ||
| } | ||
| boolean shouldRender = ownerPerspectiveId.equals(activePerspectiveId); | ||
| part.setToBeRendered(shouldRender); | ||
| updateContainerVisibility(part.getParent()); | ||
| } |
| parent.setToBeRendered(false); | ||
| updateContainerVisibility(parent.getParent()); |
Test Results 852 files ±0 852 suites ±0 53m 32s ⏱️ - 1m 7s For more details on these failures, see this check. Results for commit 44ec6d7. ± Comparison against base commit 7324f31. |
Fixes #2984.
This change keeps non-editor views dropped into the editor-area stack scoped to the active perspective instead of making them globally visible across perspectives.
What changed:
Result: