Fix con_id criteria and move-to-mark for workspaces in i3 RPC #8980
+261
−51
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.
Summary
This PR fixes
[con_id=X]criteria to match workspace nodes, bringing sway's behavior in line with i3. It also adds marks support for workspaces and fixesmove container to markbehavior for split targets.Problem
In i3,
[con_id=X]works for all node types including workspaces. In sway, it only matches containers, breaking scripts that rely on targeting workspaces by their internal ID.Reproduce on master:
Use Case
A "move to parent" helper that reparents a container to be a sibling of its current parent:
This works in i3 but fails in sway when the grandparent is a workspace.
Changes
fix(criteria): allow con_id to match workspaces - Extend
criteria_get_nodes()to iterate workspaces whencon_idis specifiedfeat(workspace): add marks support to workspaces - Workspaces can now have marks like containers, enabling the full "move to mark" pattern
fix(move): match i3 behavior for move-to-mark on split targets - When moving to a mark on a workspace or split container, descend to the focused child and add as sibling (matching i3's
con_move_to_targetbehavior)Test Plan