Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,16 @@ private void subscribeRenderingChanged(
int visCount = modelService.countRenderableChildren(container);

// Remove stacks with no visible children from the display (but not the
// model). Since event delivery is synchronous (EventBroker.send via
// EventAdmin.sendEvent and Display.syncExec), the visCount reflects
// the actual state at the time of this event and can be acted upon
// immediately without deferring via asyncExec.
if (visCount == 0 && !isLastEditorStack(container)) {
container.setToBeRendered(false);
transferPrimaryDataStackIfRemoved(container);
// model)
final MElementContainer<MUIElement> theContainer = container;
if (visCount == 0) {
Display.getCurrent().asyncExec(() -> {
int visCount1 = modelService.countRenderableChildren(theContainer);
if (!isLastEditorStack(theContainer) && visCount1 == 0) {
theContainer.setToBeRendered(false);
transferPrimaryDataStackIfRemoved(theContainer);
}
});
} else if (container.getParent() != null) { // omit detached windows
// if there are rendered elements but none are 'visible' we should
// make the container invisible as well
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2445,6 +2445,9 @@ public void ensureCleanUpAddonCleansUp() {

assertTrue(partStackForPartBPartC.isToBeRendered(), " PartStack with children should be rendered");
partService.hidePart(partB);
// Drain pending events between hides so that the event queue is clean
// when the second hidePart queues CleanupAddon's asyncExec for visCount==0
contextRule.spinEventLoop();
partService.hidePart(partC);
contextRule.spinEventLoop();
assertFalse(partStackForPartBPartC.isToBeRendered(),
Expand Down
Loading