commit f167acce3a11f342df5fef21679ae4eb8624ae15
parent 3dffe7f3a641848b246b7c543c0c3ec183823cdb
Author: Bill Li <billli11hkb@gmail.com>
Date: Mon, 14 Mar 2022 17:41:40 +0800
Updating criteria checking with PCRE2
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git 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;