diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-01-22 07:55:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 07:55:31 -0500 |
commit | 71a37ad186ba3080338b2ecb5a3e640600aefc1f (patch) | |
tree | 28700e832965f9bac8150f72f02dd440b8e0ca32 /sway | |
parent | root_scratchpad_remove_container: do not show (diff) | |
parent | commands: allow setting floating on scratchpad containers (diff) | |
download | sway-71a37ad186ba3080338b2ecb5a3e640600aefc1f.tar.gz sway-71a37ad186ba3080338b2ecb5a3e640600aefc1f.tar.zst sway-71a37ad186ba3080338b2ecb5a3e640600aefc1f.zip |
Merge pull request #3494 from ianyfan/commands
i3 command behaviour compatibility fixes
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/floating.c | 7 | ||||
-rw-r--r-- | sway/commands/sticky.c | 7 | ||||
-rw-r--r-- | sway/tree/container.c | 1 |
3 files changed, 2 insertions, 13 deletions
diff --git a/sway/commands/floating.c b/sway/commands/floating.c index 57bf0017..82109369 100644 --- a/sway/commands/floating.c +++ b/sway/commands/floating.c | |||
@@ -40,12 +40,7 @@ struct cmd_results *cmd_floating(int argc, char **argv) { | |||
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
43 | if (container->scratchpad && !container->workspace) { | 43 | bool wants_floating = |
44 | return cmd_results_new(CMD_FAILURE, | ||
45 | "Cannot set floating status on a hidden scratchpad container"); | ||
46 | } | ||
47 | |||
48 | bool wants_floating = | ||
49 | parse_boolean(argv[0], container_is_floating(container)); | 44 | parse_boolean(argv[0], container_is_floating(container)); |
50 | 45 | ||
51 | container_set_floating(container, wants_floating); | 46 | 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) { | |||
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 | if (!container_is_floating(container)) { | ||
26 | return cmd_results_new(CMD_FAILURE, | ||
27 | "Can't set sticky on a tiled container"); | ||
28 | } | ||
29 | |||
30 | container->is_sticky = parse_boolean(argv[0], container->is_sticky); | 25 | container->is_sticky = parse_boolean(argv[0], container->is_sticky); |
31 | 26 | ||
32 | if (container->is_sticky && | 27 | if (container->is_sticky && container_is_floating_or_child(container) && |
33 | (!container->scratchpad || container->workspace)) { | 28 | (!container->scratchpad || container->workspace)) { |
34 | // move container to active workspace | 29 | // move container to active workspace |
35 | struct sway_workspace *active_workspace = | 30 | 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) { | |||
708 | container->border = container->saved_border; | 708 | container->border = container->saved_border; |
709 | } | 709 | } |
710 | } | 710 | } |
711 | container->is_sticky = false; | ||
712 | } | 711 | } |
713 | 712 | ||
714 | container_end_mouse_operation(container); | 713 | container_end_mouse_operation(container); |