From a120d4c79f9406a2f7cc38c60069d3183c98ea87 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 15 Jul 2018 15:20:21 +1000 Subject: 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). --- include/sway/tree/container.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sway/tree') diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 11780916..04e50fc6 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -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; -- cgit v1.2.3