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 | |
parent | e0a94bee8da3271f942c0881ee18a7e2d4138063 (diff) | |
download | sway-2c917a8c3453ec54a80581d82bc8a520e822bd56.tar.xz |
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')
-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) { return false; } +bool container_is_current_floating(struct sway_container *container) { + if (!container->current.parent && container->current.workspace && + list_find(container->current.workspace->floating, container) != -1) { + return true; + } + if (container->scratchpad) { + return true; + } + return false; +} + void container_get_box(struct sway_container *container, struct wlr_box *box) { box->x = container->pending.x; box->y = container->pending.y; |