fix(criteria): allow con_id to match workspaces

The [con_id=X] criteria selector was failing to match workspace nodes
because criteria_get_containers() only iterated through containers, not
workspaces. This broke scripts that rely on marking workspaces by their
internal ID (a pattern that works in i3).

Rename criteria_get_containers to criteria_get_nodes and extend it to
also iterate over workspaces when con_id is specified. Workspaces only
support con_id matching (not con_mark, since they don't have marks).

🤖 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:28:35 +00:00 committed by Vladimir Panteleev
parent dbe8640035
commit e7bd3f14e5
No known key found for this signature in database
GPG key ID: 5004F0FAD051576D
3 changed files with 30 additions and 15 deletions

View file

@ -84,8 +84,9 @@ struct criteria *criteria_parse(char *raw, char **error);
list_t *criteria_for_view(struct sway_view *view, enum criteria_type types);
/**
* Compile a list of containers matching the given criteria.
* Compile a list of nodes matching the given criteria.
* Returns a list of struct sway_node *.
*/
list_t *criteria_get_containers(struct criteria *criteria);
list_t *criteria_get_nodes(struct criteria *criteria);
#endif