feat(workspace): add marks support to workspaces

Workspaces can now have marks just like containers. This enables the
pattern of marking a workspace with [con_id=X] and then using
"move container to mark" to reparent containers to workspaces.

Changes:
- Add marks list to sway_workspace struct
- Add workspace_has_mark, workspace_add_mark, workspace_clear_marks,
  workspace_find_and_unmark, workspace_find_mark functions
- Update mark command to work on workspaces when targeted via criteria
- Update unmark command to support workspaces
- Update move.c to find marks on workspaces for "move to mark"
- Update criteria con_mark matching to also check workspaces
- Add workspace marks to IPC JSON output

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Code 2025-12-27 09:35:00 +00:00 committed by Vladimir Panteleev
parent e7bd3f14e5
commit b48239588f
No known key found for this signature in database
GPG key ID: 5004F0FAD051576D
7 changed files with 183 additions and 37 deletions

View file

@ -530,6 +530,14 @@ static void ipc_json_describe_workspace(struct sway_workspace *workspace,
json_object_new_string(
ipc_json_orientation_description(workspace->layout)));
// Marks
json_object *marks = json_object_new_array();
for (int i = 0; i < workspace->marks->length; ++i) {
json_object_array_add(marks,
json_object_new_string(workspace->marks->items[i]));
}
json_object_object_add(object, "marks", marks);
// Floating
json_object *floating_array = json_object_new_array();
for (int i = 0; i < workspace->floating->length; ++i) {