mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2025-01-29 08:34:59 +01:00
Deny "move container" when an empty workspace is focused
This commit is contained in:
parent
5ac3509d54
commit
9e8d628a17
1 changed files with 4 additions and 0 deletions
|
@ -59,6 +59,10 @@ static struct cmd_results *cmd_move_container(struct sway_container *current,
|
||||||
&& strcasecmp(argv[2], "workspace") == 0) {
|
&& strcasecmp(argv[2], "workspace") == 0) {
|
||||||
// move container to workspace x
|
// move container to workspace x
|
||||||
if (current->type == C_WORKSPACE) {
|
if (current->type == C_WORKSPACE) {
|
||||||
|
if (current->children->length == 0) {
|
||||||
|
return cmd_results_new(CMD_FAILURE, "move",
|
||||||
|
"Can't move an empty workspace");
|
||||||
|
}
|
||||||
current = container_wrap_children(current);
|
current = container_wrap_children(current);
|
||||||
} else if (current->type != C_CONTAINER && current->type != C_VIEW) {
|
} else if (current->type != C_CONTAINER && current->type != C_VIEW) {
|
||||||
return cmd_results_new(CMD_FAILURE, "move",
|
return cmd_results_new(CMD_FAILURE, "move",
|
||||||
|
|
Loading…
Add table
Reference in a new issue