diff options
author | Kenny Levinsen <kl@kl.wtf> | 2021-02-22 19:33:08 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-02-22 23:55:22 +0100 |
commit | 2c917a8c3453ec54a80581d82bc8a520e822bd56 (patch) | |
tree | c589766a5462e0e6855ba2b135c0c050804fb830 /sway/tree/container.c | |
parent | render: scale titlebars correctly when straddling outputs (diff) | |
download | sway-2c917a8c3453ec54a80581d82bc8a520e822bd56.tar.gz sway-2c917a8c3453ec54a80581d82bc8a520e822bd56.tar.zst sway-2c917a8c3453ec54a80581d82bc8a520e822bd56.zip |
container: Add container_is_current_floating
Needed to check if containers are currently floating from render code,
as container_is_floating checks pending state.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 11 |
1 files changed, 11 insertions, 0 deletions
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; |