aboutsummaryrefslogtreecommitdiffstats
path: root/sway/criteria.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-12 22:33:49 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-03-12 20:52:09 -0600
commit52a61671e93953a06b6b440ede5512e8fe45b35e (patch)
tree6c00f5c8213c00729b8b90ac5488a6e08b58c394 /sway/criteria.c
parentHandle seat_get_focused_workspace returning NULL (diff)
downloadsway-52a61671e93953a06b6b440ede5512e8fe45b35e.tar.gz
sway-52a61671e93953a06b6b440ede5512e8fe45b35e.tar.zst
sway-52a61671e93953a06b6b440ede5512e8fe45b35e.zip
criteria: change workspace to support regex
This changes the workspace criteria to support regex instead of basic strings. This matches i3's behavior.
Diffstat (limited to 'sway/criteria.c')
-rw-r--r--sway/criteria.c4
1 files changed, 2 insertions, 2 deletions
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;