diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-01-28 19:06:42 +1000 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-28 10:35:40 +0100 |
commit | 6b8bf10941ec83ac7a6e364b9c34f8c6f74d814a (patch) | |
tree | 61a9e61c64fd1b88a79b06a6f9dafeb84e4f8c35 /sway/commands/sticky.c | |
parent | Add note about required scdoc version to README. (diff) | |
download | sway-6b8bf10941ec83ac7a6e364b9c34f8c6f74d814a.tar.gz sway-6b8bf10941ec83ac7a6e364b9c34f8c6f74d814a.tar.zst sway-6b8bf10941ec83ac7a6e364b9c34f8c6f74d814a.zip |
Introduce container_is_scratchpad_hidden
Just a convenience function that improves readability of the code.
Other things worth noting:
* container_get_siblings and container_sibling_index no longer use the
const keyword
* container_handle_fullscreen_reparent is only ever called after
attaching the container to a workspace, so its con->workspace check has
been changed to an assertion
Diffstat (limited to 'sway/commands/sticky.c')
-rw-r--r-- | sway/commands/sticky.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/commands/sticky.c b/sway/commands/sticky.c index e79af8af..5b70199c 100644 --- a/sway/commands/sticky.c +++ b/sway/commands/sticky.c | |||
@@ -17,15 +17,15 @@ struct cmd_results *cmd_sticky(int argc, char **argv) { | |||
17 | return error; | 17 | return error; |
18 | } | 18 | } |
19 | struct sway_container *container = config->handler_context.container; | 19 | struct sway_container *container = config->handler_context.container; |
20 | 20 | ||
21 | if (container == NULL) { | 21 | if (container == NULL) { |
22 | return cmd_results_new(CMD_FAILURE, "No current container"); | 22 | return cmd_results_new(CMD_FAILURE, "No current container"); |
23 | }; | 23 | }; |
24 | 24 | ||
25 | container->is_sticky = parse_boolean(argv[0], container->is_sticky); | 25 | container->is_sticky = parse_boolean(argv[0], container->is_sticky); |
26 | 26 | ||
27 | if (container->is_sticky && container_is_floating_or_child(container) && | 27 | if (container->is_sticky && container_is_floating_or_child(container) && |
28 | (!container->scratchpad || container->workspace)) { | 28 | !container_is_scratchpad_hidden(container)) { |
29 | // move container to active workspace | 29 | // move container to active workspace |
30 | struct sway_workspace *active_workspace = | 30 | struct sway_workspace *active_workspace = |
31 | output_get_active_workspace(container->workspace->output); | 31 | output_get_active_workspace(container->workspace->output); |