diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-25 14:58:57 +0100 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-25 14:59:07 +0100 |
commit | 5483fe18837636c091d01d0ae44614bbc5494767 (patch) | |
tree | 72239b24894c059368b1943e97e8d9bede406ad9 | |
parent | a06cb7cd01acfbb5e31dd1aacbbde7887a0509b9 (diff) |
criteria: Code formatting.
-rw-r--r-- | sway/criteria.c | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/sway/criteria.c b/sway/criteria.c index 51779590..53435d29 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -247,62 +247,62 @@ static bool criteria_test(swayc_t *cont, list_t *tokens) { for (int i = 0; i < tokens->length; i++) { struct crit_token *crit = tokens->items[i]; switch (crit->type) { - case CRIT_CLASS: - if (!cont->class) { - // ignore - } else if (strcmp(crit->raw, "focused") == 0) { - swayc_t *focused = get_focused_view(&root_container); - if (focused->class && strcmp(cont->class, focused->class) == 0) { - matches++; - } - } else if (crit->regex && regexec(crit->regex, cont->class, 0, NULL, 0) == 0) { + case CRIT_CLASS: + if (!cont->class) { + // ignore + } else if (strcmp(crit->raw, "focused") == 0) { + swayc_t *focused = get_focused_view(&root_container); + if (focused->class && strcmp(cont->class, focused->class) == 0) { matches++; } - break; - case CRIT_ID: - if (!cont->app_id) { - // ignore - } else if (crit->regex && regexec(crit->regex, cont->app_id, 0, NULL, 0) == 0) { - matches++; - } - break; - case CRIT_INSTANCE: - break; - case CRIT_TITLE: - if (!cont->name) { - // ignore - } else if (strcmp(crit->raw, "focused") == 0) { - swayc_t *focused = get_focused_view(&root_container); - if (focused->name && strcmp(cont->name, focused->name) == 0) { - matches++; - } - } else if (crit->regex && regexec(crit->regex, cont->name, 0, NULL, 0) == 0) { + } else if (crit->regex && regexec(crit->regex, cont->class, 0, NULL, 0) == 0) { + matches++; + } + break; + case CRIT_ID: + if (!cont->app_id) { + // ignore + } else if (crit->regex && regexec(crit->regex, cont->app_id, 0, NULL, 0) == 0) { + matches++; + } + break; + case CRIT_INSTANCE: + break; + case CRIT_TITLE: + if (!cont->name) { + // ignore + } else if (strcmp(crit->raw, "focused") == 0) { + swayc_t *focused = get_focused_view(&root_container); + if (focused->name && strcmp(cont->name, focused->name) == 0) { matches++; } - break; - case CRIT_URGENT: // "latest" or "oldest" - break; - case CRIT_WINDOW_ROLE: - break; - case CRIT_WINDOW_TYPE: - // TODO wlc indeed exposes this information - break; - case CRIT_WORKSPACE: ; - swayc_t *cont_ws = swayc_parent_by_type(cont, C_WORKSPACE); - if (!cont_ws || !cont_ws->name) { - // ignore - } else if (strcmp(crit->raw, "focused") == 0) { - swayc_t *focused_ws = swayc_active_workspace(); - if (focused_ws->name && strcmp(cont_ws->name, focused_ws->name) == 0) { - matches++; - } - } else if (crit->regex && regexec(crit->regex, cont_ws->name, 0, NULL, 0) == 0) { + } else if (crit->regex && regexec(crit->regex, cont->name, 0, NULL, 0) == 0) { + matches++; + } + break; + case CRIT_URGENT: // "latest" or "oldest" + break; + case CRIT_WINDOW_ROLE: + break; + case CRIT_WINDOW_TYPE: + // TODO wlc indeed exposes this information + break; + case CRIT_WORKSPACE: ; + swayc_t *cont_ws = swayc_parent_by_type(cont, C_WORKSPACE); + if (!cont_ws || !cont_ws->name) { + // ignore + } else if (strcmp(crit->raw, "focused") == 0) { + swayc_t *focused_ws = swayc_active_workspace(); + if (focused_ws->name && strcmp(cont_ws->name, focused_ws->name) == 0) { matches++; } - break; - default: - sway_abort("Invalid criteria type (%i)", crit->type); - break; + } else if (crit->regex && regexec(crit->regex, cont_ws->name, 0, NULL, 0) == 0) { + matches++; + } + break; + default: + sway_abort("Invalid criteria type (%i)", crit->type); + break; } } return matches == tokens->length; |