aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r--sway/commands/move.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index f642f023..4ebc949b 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -395,6 +395,11 @@ static struct cmd_results *cmd_move_container(int argc, char **argv) {
395 container = workspace_wrap_children(workspace); 395 container = workspace_wrap_children(workspace);
396 } 396 }
397 397
398 if (container->fullscreen_mode == FULLSCREEN_GLOBAL) {
399 return cmd_results_new(CMD_FAILURE,
400 "Can't move fullscreen global container");
401 }
402
398 bool no_auto_back_and_forth = false; 403 bool no_auto_back_and_forth = false;
399 while (strcasecmp(argv[0], "--no-auto-back-and-forth") == 0) { 404 while (strcasecmp(argv[0], "--no-auto-back-and-forth") == 0) {
400 no_auto_back_and_forth = true; 405 no_auto_back_and_forth = true;
@@ -646,6 +651,10 @@ static struct cmd_results *cmd_move_workspace(int argc, char **argv) {
646 } 651 }
647 652
648 struct sway_workspace *workspace = config->handler_context.workspace; 653 struct sway_workspace *workspace = config->handler_context.workspace;
654 if (!workspace) {
655 return cmd_results_new(CMD_FAILURE, "No workspace to move");
656 }
657
649 struct sway_output *old_output = workspace->output; 658 struct sway_output *old_output = workspace->output;
650 int center_x = workspace->width / 2 + workspace->x, 659 int center_x = workspace->width / 2 + workspace->x,
651 center_y = workspace->height / 2 + workspace->y; 660 center_y = workspace->height / 2 + workspace->y;