aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Li <billli11hkb@gmail.com>2022-03-14 17:41:40 +0800
committerSimon Ser <contact@emersion.fr>2022-03-15 11:28:04 +0100
commitf167acce3a11f342df5fef21679ae4eb8624ae15 (patch)
treedf8c06c31f63e7625939ae397264a2c0d6cdec6f
parent3dffe7f3a641848b246b7c543c0c3ec183823cdb (diff)
Updating criteria checking with PCRE2
-rw-r--r--sway/criteria.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index 4711a165..94751c5f 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -161,7 +161,7 @@ static bool criteria_matches_container(struct criteria *criteria,
bool exists = false;
struct sway_container *con = container;
for (int i = 0; i < con->marks->length; ++i) {
- if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) == 0) {
+ if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) >= 0) {
exists = true;
break;
}
@@ -199,7 +199,7 @@ static bool criteria_matches_view(struct criteria *criteria,
}
break;
case PATTERN_PCRE2:
- if (regex_cmp(title, criteria->title->regex) != 0) {
+ if (regex_cmp(title, criteria->title->regex) < 0) {
return false;
}
break;
@@ -219,7 +219,7 @@ static bool criteria_matches_view(struct criteria *criteria,
}
break;
case PATTERN_PCRE2:
- if (regex_cmp(shell, criteria->shell->regex) != 0) {
+ if (regex_cmp(shell, criteria->shell->regex) < 0) {
return false;
}
break;
@@ -239,7 +239,7 @@ static bool criteria_matches_view(struct criteria *criteria,
}
break;
case PATTERN_PCRE2:
- if (regex_cmp(app_id, criteria->app_id->regex) != 0) {
+ if (regex_cmp(app_id, criteria->app_id->regex) < 0) {
return false;
}
break;
@@ -271,7 +271,7 @@ static bool criteria_matches_view(struct criteria *criteria,
}
break;
case PATTERN_PCRE2:
- if (regex_cmp(class, criteria->class->regex) != 0) {
+ if (regex_cmp(class, criteria->class->regex) < 0) {
return false;
}
break;
@@ -291,7 +291,7 @@ static bool criteria_matches_view(struct criteria *criteria,
}
break;
case PATTERN_PCRE2:
- if (regex_cmp(instance, criteria->instance->regex) != 0) {
+ if (regex_cmp(instance, criteria->instance->regex) < 0) {
return false;
}
break;
@@ -311,7 +311,7 @@ static bool criteria_matches_view(struct criteria *criteria,
}
break;
case PATTERN_PCRE2:
- if (regex_cmp(window_role, criteria->window_role->regex) != 0) {
+ if (regex_cmp(window_role, criteria->window_role->regex) < 0) {
return false;
}
break;
@@ -370,7 +370,7 @@ static bool criteria_matches_view(struct criteria *criteria,
}
break;
case PATTERN_PCRE2:
- if (regex_cmp(ws->name, criteria->workspace->regex) != 0) {
+ if (regex_cmp(ws->name, criteria->workspace->regex) < 0) {
return false;
}
break;