diff --git a/include/sway/criteria.h b/include/sway/criteria.h index 3eb583d5a..f7e788c8b 100644 --- a/include/sway/criteria.h +++ b/include/sway/criteria.h @@ -35,7 +35,7 @@ struct criteria { bool floating; bool tiling; char urgent; // 'l' for latest or 'o' for oldest - char *workspace; + pcre *workspace; }; bool criteria_is_empty(struct criteria *criteria); diff --git a/sway/criteria.c b/sway/criteria.c index 5ad481452..f2db6c184 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -208,7 +208,7 @@ static bool criteria_matches_view(struct criteria *criteria, if (criteria->workspace) { struct sway_workspace *ws = view->container->workspace; - if (!ws || strcmp(ws->name, criteria->workspace) != 0) { + if (!ws || regex_cmp(ws->name, criteria->workspace) != 0) { return false; } } @@ -515,7 +515,7 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) { } break; case T_WORKSPACE: - criteria->workspace = strdup(effective_value); + generate_regex(&criteria->workspace, effective_value); break; case T_INVALID: break;