mirror of
https://github.com/swaywm/sway.git
synced 2024-11-16 21:23:17 +00:00
commands: prevent focusing mode with no containers
Explicitly fail when trying to focus tiling/floating when there are no tiling/floating containers.
This commit is contained in:
parent
23601a8771
commit
b3f7801fca
|
@ -52,6 +52,10 @@ static struct cmd_results *focus_mode(struct sway_container *con,
|
||||||
}
|
}
|
||||||
if (new_focus) {
|
if (new_focus) {
|
||||||
seat_set_focus(seat, new_focus);
|
seat_set_focus(seat, new_focus);
|
||||||
|
} else {
|
||||||
|
return cmd_results_new(CMD_FAILURE, "focus",
|
||||||
|
"Failed to find a %s container in workspace",
|
||||||
|
floating ? "floating" : "tiling");
|
||||||
}
|
}
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue