diff options
-rw-r--r-- | include/sway/tree/container.h | 7 | ||||
-rw-r--r-- | sway/desktop/render.c | 4 | ||||
-rw-r--r-- | sway/tree/container.c | 11 |
3 files changed, 20 insertions, 2 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index ff3f9599..5c368df2 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -210,10 +210,17 @@ void container_set_geometry_from_content(struct sway_container *con); | |||
210 | /** | 210 | /** |
211 | * Determine if the given container is itself floating. | 211 | * Determine if the given container is itself floating. |
212 | * This will return false for any descendants of a floating container. | 212 | * This will return false for any descendants of a floating container. |
213 | * | ||
214 | * Uses pending container state. | ||
213 | */ | 215 | */ |
214 | bool container_is_floating(struct sway_container *container); | 216 | bool container_is_floating(struct sway_container *container); |
215 | 217 | ||
216 | /** | 218 | /** |
219 | * Same as above, but for current container state. | ||
220 | */ | ||
221 | bool container_is_current_floating(struct sway_container *container); | ||
222 | |||
223 | /** | ||
217 | * Get a container's box in layout coordinates. | 224 | * Get a container's box in layout coordinates. |
218 | */ | 225 | */ |
219 | void container_get_box(struct sway_container *container, struct wlr_box *box); | 226 | void container_get_box(struct sway_container *container, struct wlr_box *box); |
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index ce90eae0..f314db73 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -359,7 +359,7 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage, | |||
359 | container_current_parent_layout(con); | 359 | container_current_parent_layout(con); |
360 | 360 | ||
361 | if (state->border_right) { | 361 | if (state->border_right) { |
362 | if (!container_is_floating(con) && siblings->length == 1 && layout == L_HORIZ) { | 362 | if (!container_is_current_floating(con) && siblings->length == 1 && layout == L_HORIZ) { |
363 | memcpy(&color, colors->indicator, sizeof(float) * 4); | 363 | memcpy(&color, colors->indicator, sizeof(float) * 4); |
364 | } else { | 364 | } else { |
365 | memcpy(&color, colors->child_border, sizeof(float) * 4); | 365 | memcpy(&color, colors->child_border, sizeof(float) * 4); |
@@ -374,7 +374,7 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage, | |||
374 | } | 374 | } |
375 | 375 | ||
376 | if (state->border_bottom) { | 376 | if (state->border_bottom) { |
377 | if (!container_is_floating(con) && siblings->length == 1 && layout == L_VERT) { | 377 | if (!container_is_current_floating(con) && siblings->length == 1 && layout == L_VERT) { |
378 | memcpy(&color, colors->indicator, sizeof(float) * 4); | 378 | memcpy(&color, colors->indicator, sizeof(float) * 4); |
379 | } else { | 379 | } else { |
380 | memcpy(&color, colors->child_border, sizeof(float) * 4); | 380 | memcpy(&color, colors->child_border, sizeof(float) * 4); |
diff --git a/sway/tree/container.c b/sway/tree/container.c index 8c8dfb3b..79c23274 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -858,6 +858,17 @@ bool container_is_floating(struct sway_container *container) { | |||
858 | return false; | 858 | return false; |
859 | } | 859 | } |
860 | 860 | ||
861 | bool container_is_current_floating(struct sway_container *container) { | ||
862 | if (!container->current.parent && container->current.workspace && | ||
863 | list_find(container->current.workspace->floating, container) != -1) { | ||
864 | return true; | ||
865 | } | ||
866 | if (container->scratchpad) { | ||
867 | return true; | ||
868 | } | ||
869 | return false; | ||
870 | } | ||
871 | |||
861 | void container_get_box(struct sway_container *container, struct wlr_box *box) { | 872 | void container_get_box(struct sway_container *container, struct wlr_box *box) { |
862 | box->x = container->pending.x; | 873 | box->x = container->pending.x; |
863 | box->y = container->pending.y; | 874 | box->y = container->pending.y; |