diff options
-rw-r--r-- | include/sway/criteria.h | 2 | ||||
-rw-r--r-- | sway/criteria.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/sway/criteria.h b/include/sway/criteria.h index 3eb583d5..f7e788c8 100644 --- a/include/sway/criteria.h +++ b/include/sway/criteria.h | |||
@@ -35,7 +35,7 @@ struct criteria { | |||
35 | bool floating; | 35 | bool floating; |
36 | bool tiling; | 36 | bool tiling; |
37 | char urgent; // 'l' for latest or 'o' for oldest | 37 | char urgent; // 'l' for latest or 'o' for oldest |
38 | char *workspace; | 38 | pcre *workspace; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | bool criteria_is_empty(struct criteria *criteria); | 41 | bool criteria_is_empty(struct criteria *criteria); |
diff --git a/sway/criteria.c b/sway/criteria.c index 5ad48145..f2db6c18 100644 --- a/sway/criteria.c +++ b/sway/criteria.c | |||
@@ -208,7 +208,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
208 | 208 | ||
209 | if (criteria->workspace) { | 209 | if (criteria->workspace) { |
210 | struct sway_workspace *ws = view->container->workspace; | 210 | struct sway_workspace *ws = view->container->workspace; |
211 | if (!ws || strcmp(ws->name, criteria->workspace) != 0) { | 211 | if (!ws || regex_cmp(ws->name, criteria->workspace) != 0) { |
212 | return false; | 212 | return false; |
213 | } | 213 | } |
214 | } | 214 | } |
@@ -515,7 +515,7 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) { | |||
515 | } | 515 | } |
516 | break; | 516 | break; |
517 | case T_WORKSPACE: | 517 | case T_WORKSPACE: |
518 | criteria->workspace = strdup(effective_value); | 518 | generate_regex(&criteria->workspace, effective_value); |
519 | break; | 519 | break; |
520 | case T_INVALID: | 520 | case T_INVALID: |
521 | break; | 521 | break; |