Repository navigation
fix: keep each workspace's windows apart when a workspace is removed - #572
Open
mattchristenson wants to merge 1 commit into
Open
mattchristenson wants to merge 1 commit into
mattchristenson wants to merge 1 commit into
Conversation
Workspace and monitor nodes are named by workspace index (ws{n}, mo{m}ws{n}).
When GNOME removes a workspace (dynamic workspaces: its last window closed), it
renumbers the ones after it, but Forge only dropped the removed node. The next
window placed by its workspace index was filed under another workspace's node,
and the windows of two workspaces shared one split (forge-ext#470).
Rename the nodes of the following workspaces down by one on removal.
Fixes forge-ext#470
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #470.
Problem. With dynamic workspaces, closing the last window of a workspace removes that workspace, and GNOME renumbers the ones after it. Forge's tree names its workspace and monitor nodes by index (
ws1,mo0ws1, ...).removeWorkspace()dropped the removed node, but it didn't rename the others. So workspace 2 (now index 1) kept its nodews2, whilews1still held the old workspace 1's windows. The next time a window was placed by its workspace index, it was filed under another workspace's node. Windows of two workspaces then shared one split, each at half width, as reported in #470.Change.
Tree._renumberWorkspaces(fromIndex)renames the workspace nodes after the removed one, and their monitor nodes, down by one;removeWorkspace()calls it. Containers aren't named by index, so they need no change. Inserting a workspace needs nothing: GNOME always adds a workspace at the end and moves the windows after the insertion point up one index, each through its own workspace change, which Forge already follows.Not in this PR. The
workspace-skip-tilesetting also lists workspaces by index. After a removal, the numbers in it point at different workspaces. Whether that setting should follow the workspace or the number is a separate question.Merging note. With #557 (stale tab bars),
removeWorkspace()also calls_forgetRemoved(); keep both calls, that one first.Testing. Scenario
scenarios/19_workspace_removed.py:main, the two remaining windows are filed under the same workspace node and each is half wide. With this PR, each fills its own workspace.main0/3 → 3/3. The rest of the suite is unchanged againstmain. It was also run on a build together with the other open PRs, in the sandbox and in a real GNOME Shell 50 session.prettier@2.7.1 --checkis clean.How to reproduce by hand. Dynamic workspaces on. Put one window on each of workspaces 1, 2 and 3. Close the one on workspace 1. The windows now on workspaces 1 and 2 should each fill their workspace. On
main, they are laid out as if they were on the same workspace, each at half width.🤖 Generated with Claude Code