From 8d700fe008ccf9f7eb4664e236277c9f30a449fb Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Fri, 1 Apr 2016 13:36:36 +0200 Subject: Fix problems with floating windows Makes any tabbed/stacked layout a container to separate from floating windows which may be attached to a workspace. --- include/container.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index 26da851e..d9f33b8a 100644 --- a/include/container.h +++ b/include/container.h @@ -240,6 +240,12 @@ bool swayc_is_parent_of(swayc_t *parent, swayc_t *child); * Returns true if the child is a desecendant of the parent. */ bool swayc_is_child_of(swayc_t *child, swayc_t *parent); + +/** + * Returns true if view is stacked or tabbed. + */ +bool swayc_is_tabbed_stacked(swayc_t *view); + /** * Returns the gap (padding) of the container. * -- cgit v1.2.3 From e226b20bd8d2ce98077aee35b2a33b73943db247 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Sat, 2 Apr 2016 16:29:31 +0200 Subject: Reapply prev layout when exiting tabbed/stacked --- include/container.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index d9f33b8a..29d4ea12 100644 --- a/include/container.h +++ b/include/container.h @@ -56,6 +56,7 @@ struct sway_container { enum swayc_types type; enum swayc_layouts layout; + enum swayc_layouts prev_layout; /** * Width and height of this container, without borders or gaps. -- cgit v1.2.3 From 3e1f78ab26e8bc6b6cefd53ee137e97533c2695e Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Wed, 20 Apr 2016 00:22:15 +0200 Subject: Add support for nested tabbed/stacked containers --- include/container.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index 29d4ea12..ae57d1e3 100644 --- a/include/container.h +++ b/include/container.h @@ -2,9 +2,12 @@ #define _SWAY_CONTAINER_H #include #include + +#include "list.h" + typedef struct sway_container swayc_t; -#include "layout.h" +extern swayc_t root_container; /** * Different kinds of containers. @@ -75,6 +78,12 @@ struct sway_container { */ double x, y; + /** + * Cached geometry used to store view/container geometry when switching + * between tabbed/stacked and horizontal/vertical layouts. + */ + struct wlc_geometry cached_geometry; + /** * False if this view is invisible. It could be in the scratchpad or on a * workspace that is not shown. @@ -120,7 +129,7 @@ struct sway_container { * If this container is a view, this may be set to the window's decoration * buffer (or NULL). */ - unsigned char *border; + struct border *border; enum swayc_border_types border_type; struct wlc_geometry border_geometry; struct wlc_geometry title_bar_geometry; @@ -247,6 +256,12 @@ bool swayc_is_child_of(swayc_t *child, swayc_t *parent); */ bool swayc_is_tabbed_stacked(swayc_t *view); +/** + * Returns the top most tabbed or stacked parent container. Returns NULL if + * view is not in a tabbed/stacked layout. + */ +swayc_t *swayc_tabbed_stacked_parent(swayc_t *view); + /** * Returns the gap (padding) of the container. * -- cgit v1.2.3 From 856ac7d5cca35dcff2f484003fceba1217b1e491 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Sun, 24 Apr 2016 22:04:26 +0200 Subject: Remove unused function --- include/container.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index ae57d1e3..d1905720 100644 --- a/include/container.h +++ b/include/container.h @@ -251,11 +251,6 @@ bool swayc_is_parent_of(swayc_t *parent, swayc_t *child); */ bool swayc_is_child_of(swayc_t *child, swayc_t *parent); -/** - * Returns true if view is stacked or tabbed. - */ -bool swayc_is_tabbed_stacked(swayc_t *view); - /** * Returns the top most tabbed or stacked parent container. Returns NULL if * view is not in a tabbed/stacked layout. -- cgit v1.2.3