diff options
author | Ian Fan <ianfan0@gmail.com> | 2019-01-22 11:07:32 +0000 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2019-01-22 11:47:48 +0000 |
commit | 34dea3d9d26a4e50c435a0fc51933fea956743cd (patch) | |
tree | d94059d2246a5d8ea9405a44952c8088dbd924d7 | |
parent | 42f8a038c9740bb39690446865406c551c755d96 (diff) |
commands: allow tiled containers to be stickied
This also stops stickied containers from losing its sticky status when
it is tiled, allowing it to be immediately stickied when floated again.
-rw-r--r-- | sway/commands/floating.c | 2 | ||||
-rw-r--r-- | sway/commands/sticky.c | 7 | ||||
-rw-r--r-- | sway/tree/container.c | 1 |
3 files changed, 2 insertions, 8 deletions
diff --git a/sway/commands/floating.c b/sway/commands/floating.c index 57bf0017..52e4ed08 100644 --- a/sway/commands/floating.c +++ b/sway/commands/floating.c @@ -45,7 +45,7 @@ struct cmd_results *cmd_floating(int argc, char **argv) { "Cannot set floating status on a hidden scratchpad container"); } - bool wants_floating = + bool wants_floating = parse_boolean(argv[0], container_is_floating(container)); container_set_floating(container, wants_floating); diff --git a/sway/commands/sticky.c b/sway/commands/sticky.c index 15b726cc..e79af8af 100644 --- a/sway/commands/sticky.c +++ b/sway/commands/sticky.c @@ -22,14 +22,9 @@ struct cmd_results *cmd_sticky(int argc, char **argv) { return cmd_results_new(CMD_FAILURE, "No current container"); }; - if (!container_is_floating(container)) { - return cmd_results_new(CMD_FAILURE, - "Can't set sticky on a tiled container"); - } - container->is_sticky = parse_boolean(argv[0], container->is_sticky); - if (container->is_sticky && + if (container->is_sticky && container_is_floating_or_child(container) && (!container->scratchpad || container->workspace)) { // move container to active workspace struct sway_workspace *active_workspace = diff --git a/sway/tree/container.c b/sway/tree/container.c index 97a52d91..0c0684c0 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -708,7 +708,6 @@ void container_set_floating(struct sway_container *container, bool enable) { container->border = container->saved_border; } } - container->is_sticky = false; } container_end_mouse_operation(container); |