mirror of
https://github.com/swaywm/sway.git
synced 2026-04-17 06:46:32 -04:00
container: Add container_is_current_floating
Needed to check if containers are currently floating from render code, as container_is_floating checks pending state.
This commit is contained in:
parent
e0a94bee8d
commit
2c917a8c34
3 changed files with 20 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue