From a047b5ee4a2a67d30d93641ff86531d54b8e0879 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Fri, 12 Feb 2021 23:22:51 +0100 Subject: container: Move pending state to state struct Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending. --- sway/criteria.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/criteria.c') diff --git a/sway/criteria.c b/sway/criteria.c index 409160c5..d2a5566f 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -351,7 +351,7 @@ static bool criteria_matches_view(struct criteria *criteria, } if (criteria->workspace) { - struct sway_workspace *ws = view->container->workspace; + struct sway_workspace *ws = view->container->pending.workspace; if (!ws) { return false; } @@ -359,7 +359,7 @@ static bool criteria_matches_view(struct criteria *criteria, switch (criteria->workspace->match_type) { case PATTERN_FOCUSED: if (focused && - strcmp(ws->name, focused->container->workspace->name)) { + strcmp(ws->name, focused->container->pending.workspace->name)) { return false; } break; -- cgit v1.2.3-54-g00ecf