aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/sticky.c
diff options
context:
space:
mode:
authorLibravatar Tudor Brindus <me@tbrindus.ca>2020-11-03 00:16:15 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2020-11-11 20:43:58 -0500
commit07042486c3c4b8e7083405ba9b34b1b87f8d396d (patch)
tree5ec7b68db2acbc1c68538a08b0b039477e8f8858 /sway/commands/sticky.c
parentAdd missing includes for wlr_input_device.h (diff)
downloadsway-07042486c3c4b8e7083405ba9b34b1b87f8d396d.tar.gz
sway-07042486c3c4b8e7083405ba9b34b1b87f8d396d.tar.zst
sway-07042486c3c4b8e7083405ba9b34b1b87f8d396d.zip
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.)
Diffstat (limited to 'sway/commands/sticky.c')
-rw-r--r--sway/commands/sticky.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/sticky.c b/sway/commands/sticky.c
index 9df1fe09..3c93a276 100644
--- a/sway/commands/sticky.c
+++ b/sway/commands/sticky.c
@@ -25,7 +25,7 @@ struct cmd_results *cmd_sticky(int argc, char **argv) {
25 25
26 container->is_sticky = parse_boolean(argv[0], container->is_sticky); 26 container->is_sticky = parse_boolean(argv[0], container->is_sticky);
27 27
28 if (container->is_sticky && container_is_floating_or_child(container) && 28 if (container_is_sticky_or_child(container) &&
29 !container_is_scratchpad_hidden(container)) { 29 !container_is_scratchpad_hidden(container)) {
30 // move container to active workspace 30 // move container to active workspace
31 struct sway_workspace *active_workspace = 31 struct sway_workspace *active_workspace =