aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Callum Andrew <calcium@mailbox.org>2022-11-04 12:31:00 +1100
committerLibravatar Simon Ser <contact@emersion.fr>2022-11-04 10:02:11 +0100
commit3e19836f0e4d5c1cd68ea205a377b8cd491e6757 (patch)
treeba8e31c42ca55f64c4979f6b1fca8c2bf0605993 /sway
parentcriteria: allow matching on empty (NULL) titles (diff)
downloadsway-3e19836f0e4d5c1cd68ea205a377b8cd491e6757.tar.gz
sway-3e19836f0e4d5c1cd68ea205a377b8cd491e6757.tar.zst
sway-3e19836f0e4d5c1cd68ea205a377b8cd491e6757.zip
criteria: allow matching for NULL string criteria
Diffstat (limited to 'sway')
-rw-r--r--sway/criteria.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index e62f9c1f..0f161834 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -210,7 +210,7 @@ static bool criteria_matches_view(struct criteria *criteria,
210 if (criteria->shell) { 210 if (criteria->shell) {
211 const char *shell = view_get_shell(view); 211 const char *shell = view_get_shell(view);
212 if (!shell) { 212 if (!shell) {
213 return false; 213 shell = "";
214 } 214 }
215 215
216 switch (criteria->shell->match_type) { 216 switch (criteria->shell->match_type) {
@@ -230,7 +230,7 @@ static bool criteria_matches_view(struct criteria *criteria,
230 if (criteria->app_id) { 230 if (criteria->app_id) {
231 const char *app_id = view_get_app_id(view); 231 const char *app_id = view_get_app_id(view);
232 if (!app_id) { 232 if (!app_id) {
233 return false; 233 app_id = "";
234 } 234 }
235 235
236 switch (criteria->app_id->match_type) { 236 switch (criteria->app_id->match_type) {
@@ -262,7 +262,7 @@ static bool criteria_matches_view(struct criteria *criteria,
262 if (criteria->class) { 262 if (criteria->class) {
263 const char *class = view_get_class(view); 263 const char *class = view_get_class(view);
264 if (!class) { 264 if (!class) {
265 return false; 265 class = "";
266 } 266 }
267 267
268 switch (criteria->class->match_type) { 268 switch (criteria->class->match_type) {
@@ -282,7 +282,7 @@ static bool criteria_matches_view(struct criteria *criteria,
282 if (criteria->instance) { 282 if (criteria->instance) {
283 const char *instance = view_get_instance(view); 283 const char *instance = view_get_instance(view);
284 if (!instance) { 284 if (!instance) {
285 return false; 285 instance = "";
286 } 286 }
287 287
288 switch (criteria->instance->match_type) { 288 switch (criteria->instance->match_type) {
@@ -302,7 +302,7 @@ static bool criteria_matches_view(struct criteria *criteria,
302 if (criteria->window_role) { 302 if (criteria->window_role) {
303 const char *window_role = view_get_window_role(view); 303 const char *window_role = view_get_window_role(view);
304 if (!window_role) { 304 if (!window_role) {
305 return false; 305 window_role = "";
306 } 306 }
307 307
308 switch (criteria->window_role->match_type) { 308 switch (criteria->window_role->match_type) {