Skip to content

fix(wm): preserve surviving containers during cached workspace cleanup - #1773

Open
MattKotsenas wants to merge 1 commit into
LGUG2Z:masterfrom
MattKotsenas:bugfix/preserve-cached-containers
Open

MattKotsenas wants to merge 1 commit into
LGUG2Z:masterfrom
MattKotsenas:bugfix/preserve-cached-containers

Conversation

@MattKotsenas

Copy link
Copy Markdown
Contributor

Summary

Fixes a cleanup bug that could leave open windows unmanaged when a monitor reconnects.

The previous cleanup collected empty-container indices, then removed them in ascending order. Each removal shifted later indices, so a later removal could discard a container that still held an open window.

Changes

Resolve each empty container by its stable ID before removing it through the existing lock-aware method. Preserve the focused container by ID when it survives. The existing resize bookkeeping and scrolling-departure hooks remain in use.

This fix is independent of RDP topology reconciliation. Cache identity and cached preselect-removal policy are unchanged.

Validation

  • A pure workspace-state test covers combinations of empty containers, locked containers, and focused indices. It checks surviving windows, focus, locked flags, and resize bookkeeping.
  • The test failed when the helper used the old ascending-index algorithm and passed again after restoring the fix.

Cached workspace cleanup removed saved empty-container indices in ascending order, so earlier
removals could shift a surviving container into a later removal slot. Resolve each empty container
by stable identity through the existing lock-aware removal path, then restore surviving focus by
identity.

Keep resize bookkeeping and scrolling-departure hooks intact. Cover empty, locked and focused
combinations with a pure workspace-state regression test and verify it rejects the old algorithm.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant