view: double buffer focus, use counter not bool

- Double buffering focus state ensures that border color is kept in sync
with the transaction state of views in the layout.
- Using a counter instead of a bool will allow for proper handling of
multiple seats. This is done in the same commit to avoid more churn in
the future.
This commit is contained in:
Isaac Freund
2020-08-03 15:00:04 +02:00
parent 7d77160fe3
commit 96a91fd2f7
8 changed files with 49 additions and 54 deletions

View File

@ -555,7 +555,7 @@ fn viewSurfaceAt(output: Output, ox: f64, oy: f64, sx: *f64, sy: *f64) ?*c.wlr_s
// Focused views are rendered on top, so look for them first.
var it = ViewStack(View).iterator(output.views.first, output.current.tags);
while (it.next()) |node| {
if (!node.view.focused) continue;
if (node.view.current.focus == 0) continue;
if (node.view.surfaceAt(ox, oy, sx, sy)) |found| return found;
}