view: introduce state struct to simplify code

The state struct holds all of the state that is double-buffered and
applied through transactions. This more explicit handling simplifies
much of the code, and will allow for easier implementation of new
feature such as fullscreen.
This commit is contained in:
Isaac Freund
2020-06-27 22:43:15 +02:00
parent 89d0fb012d
commit c04112b81a
12 changed files with 105 additions and 124 deletions

View File

@ -125,7 +125,7 @@ pub fn focus(self: *Self, _view: ?*View) void {
// If view is null or not currently visible
if (if (view) |v|
v.output != self.focused_output or
v.current_tags & self.focused_output.current_focused_tags == 0
v.current.tags & self.focused_output.current_focused_tags == 0
else
true) {
// Set view to the first currently visible view on in the focus stack if any