mirror of
https://github.com/swaywm/sway.git
synced 2026-04-23 06:46:27 -04:00
tree/container: introduce container_is_sticky[_or_child] functions
To query whether a container is sticky, checking `con->is_sticky` is insufficient. `container_is_floating_or_child` must also return true; this led to a lot of repetition. This commit introduces `container_is_sticky[_or_child]` functions, and switches all stickiness checks to use them. (Including ones where the container is already known to be floating, for consistency.)
This commit is contained in:
parent
a56098a24e
commit
07042486c3
7 changed files with 25 additions and 14 deletions
|
|
@ -1609,3 +1609,11 @@ bool container_is_scratchpad_hidden_or_child(struct sway_container *con) {
|
|||
con = container_toplevel_ancestor(con);
|
||||
return con->scratchpad && !con->workspace;
|
||||
}
|
||||
|
||||
bool container_is_sticky(struct sway_container *con) {
|
||||
return con->is_sticky && container_is_floating(con);
|
||||
}
|
||||
|
||||
bool container_is_sticky_or_child(struct sway_container *con) {
|
||||
return container_is_sticky(container_toplevel_ancestor(con));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue