Make focus part of transactions

Rather than maintain copies of the entire focus stack, this PR
transactionises the focus by introducing two new properties to the
container state and using those when rendering.

* `bool focused` means this container has actual focus. Only one
container should have this equalling true in its current state.
* `struct sway_container *focus_inactive_child` points to the immediate
child that was most recently focused (eg. for tabbed and stacked
containers).
This commit is contained in:
Ryan Dwyer 2018-07-15 15:20:21 +10:00
parent 53e3f35ba3
commit a120d4c79f
10 changed files with 55 additions and 73 deletions

View file

@ -68,6 +68,9 @@ struct sway_container_state {
struct sway_container *parent;
list_t *children;
struct sway_container *focused_inactive_child;
bool focused;
// View properties
double view_x, view_y;
double view_width, view_height;