view: don't use bitset for VIEW_EDGE_ALL

We will use bitset for views snapped to corner (e.g. top-left = TOP|LEFT)
This commit is contained in:
tokyo4j 2025-08-02 21:11:12 +09:00 committed by Johan Malm
parent 4b0ac0234c
commit 6441bd58f3
2 changed files with 10 additions and 6 deletions

View file

@ -72,9 +72,7 @@ enum view_edge {
VIEW_EDGE_UP = (1 << 2),
VIEW_EDGE_DOWN = (1 << 3),
VIEW_EDGE_CENTER = (1 << 4),
VIEW_EDGE_ALL = (VIEW_EDGE_LEFT | VIEW_EDGE_RIGHT |
VIEW_EDGE_UP | VIEW_EDGE_DOWN | VIEW_EDGE_CENTER),
VIEW_EDGE_ANY = (1 << 5),
};
enum view_wants_focus {

View file

@ -169,8 +169,14 @@ view_matches_query(struct view *view, struct view_query *query)
return false;
}
if (query->tiled != VIEW_EDGE_INVALID && !(query->tiled & view->tiled)) {
return false;
if (query->tiled == VIEW_EDGE_ANY) {
if (!view->tiled) {
return false;
}
} else if (query->tiled != VIEW_EDGE_INVALID) {
if (query->tiled != view->tiled) {
return false;
}
}
const char *tiled_region =
@ -2136,7 +2142,7 @@ view_edge_parse(const char *direction, bool tiled, bool any)
if (any) {
if (!strcasecmp(direction, "any")) {
return VIEW_EDGE_ALL;
return VIEW_EDGE_ANY;
}
}