From f78d07d39bb4e401920efb1396cb85d9cadd8adf Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 31 Jul 2016 18:10:33 -0400 Subject: Implement focus handling for containers The previous implementation of focus handling assumed that only views can be focused. Containers can also be focused with a command like `focus parent` or `focus child`. Change `set_focused_container()` to handle the case of the given container being a container with children and update borders accordingly. --- include/border.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/border.h b/include/border.h index b629ba46..b61b0f8a 100644 --- a/include/border.h +++ b/include/border.h @@ -16,6 +16,11 @@ struct border { */ void border_clear(struct border *border); +/** + * Recursively update all of the borders within a container. + */ +void update_container_border(swayc_t *container); + void render_view_borders(wlc_handle view); void update_view_border(swayc_t *view); void map_update_view_border(swayc_t *view, void *data); -- cgit v1.2.3 From b39249508f458e302d843c440db8f992e1d545ca Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 31 Jul 2016 20:32:40 -0400 Subject: Refactor functions to update container borders Replace `update_view_border()` with `update_container_border()`. The latter should handle both the case where the container is a view or if the container has children. --- include/border.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/border.h b/include/border.h index b61b0f8a..b72dc5dc 100644 --- a/include/border.h +++ b/include/border.h @@ -22,7 +22,6 @@ void border_clear(struct border *border); void update_container_border(swayc_t *container); void render_view_borders(wlc_handle view); -void update_view_border(swayc_t *view); void map_update_view_border(swayc_t *view, void *data); int get_font_text_height(const char *font); bool should_hide_top_border(swayc_t *con, double y); -- cgit v1.2.3