X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fmatch.c;h=f1bc8430d45fca43db596b293dd71bfed959304d;hb=00cf467114ac15a9f7eb937c761939727fb741a2;hp=d16ff0a00b4a50d91bdbf55c232e26dd0edc71d8;hpb=d9ca3e4274e117f6270d8f3b5b99a97073749b42;p=i3%2Fi3 diff --git a/src/match.c b/src/match.c index d16ff0a0..f1bc8430 100644 --- a/src/match.c +++ b/src/match.c @@ -27,8 +27,10 @@ */ void match_init(Match *match) { memset(match, 0, sizeof(Match)); - match->dock = -1; + match->dock = M_DONTCHECK; match->urgent = U_DONTCHECK; + /* we use this as the placeholder value for "not set". */ + match->window_type = UINT32_MAX; } /* @@ -48,6 +50,7 @@ bool match_is_empty(Match *match) { match->window_role == NULL && match->urgent == U_DONTCHECK && match->id == XCB_NONE && + match->window_type == UINT32_MAX && match->con_id == NULL && match->dock == -1 && match->floating == M_ANY); @@ -129,6 +132,14 @@ bool match_matches_window(Match *match, i3Window *window) { } } + if (match->window_type != UINT32_MAX) { + if (window->window_type == match->window_type) { + LOG("window_type matches (%i)\n", match->window_type); + } else { + return false; + } + } + Con *con = NULL; if (match->urgent == U_LATEST) { /* if the window isn't urgent, no sense in searching */ @@ -161,7 +172,7 @@ bool match_matches_window(Match *match, i3Window *window) { LOG("urgent matches oldest\n"); } - if (match->dock != -1) { + if (match->dock != M_DONTCHECK) { if ((window->dock == W_DOCK_TOP && match->dock == M_DOCK_TOP) || (window->dock == W_DOCK_BOTTOM && match->dock == M_DOCK_BOTTOM) || ((window->dock == W_DOCK_TOP || window->dock == W_DOCK_BOTTOM) &&