aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2019-01-28 19:06:42 +1000
committerLibravatar emersion <contact@emersion.fr>2019-01-28 10:35:40 +0100
commit6b8bf10941ec83ac7a6e364b9c34f8c6f74d814a (patch)
tree61a9e61c64fd1b88a79b06a6f9dafeb84e4f8c35 /sway/commands/move.c
parentAdd note about required scdoc version to README. (diff)
downloadsway-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/move.c')
-rw-r--r--sway/commands/move.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index aa06b168..8c3afae9 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -659,7 +659,7 @@ static struct cmd_results *cmd_move_in_direction(
659 return cmd_results_new(CMD_FAILURE, 659 return cmd_results_new(CMD_FAILURE,
660 "Cannot move workspaces in a direction"); 660 "Cannot move workspaces in a direction");
661 } 661 }
662 if (container->scratchpad && !container->workspace) { 662 if (container_is_scratchpad_hidden(container)) {
663 return cmd_results_new(CMD_FAILURE, 663 return cmd_results_new(CMD_FAILURE,
664 "Cannot move a hidden scratchpad container"); 664 "Cannot move a hidden scratchpad container");
665 } 665 }
@@ -734,7 +734,7 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) {
734 return cmd_results_new(CMD_FAILURE, "Only floating containers " 734 return cmd_results_new(CMD_FAILURE, "Only floating containers "
735 "can be moved to an absolute position"); 735 "can be moved to an absolute position");
736 } 736 }
737 if (container->scratchpad && !container->workspace) { 737 if (container_is_scratchpad_hidden(container)) {
738 return cmd_results_new(CMD_FAILURE, 738 return cmd_results_new(CMD_FAILURE,
739 "Cannot move a hidden scratchpad container"); 739 "Cannot move a hidden scratchpad container");
740 } 740 }