mirror of
https://github.com/swaywm/sway.git
synced 2026-03-19 05:34:00 -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
|
|
@ -1151,7 +1151,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
|
|||
for (int i = 0; i < new_output_last_ws->floating->length; ++i) {
|
||||
struct sway_container *floater =
|
||||
new_output_last_ws->floating->items[i];
|
||||
if (floater->is_sticky) {
|
||||
if (container_is_sticky(floater)) {
|
||||
container_detach(floater);
|
||||
workspace_add_floating(new_workspace, floater);
|
||||
--i;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue