mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
seat_cmd_cursor: do not create non-existing seat
If a seat does not exist in seat_cmd_cursor, do not create it. A seat without any attachments is useless since it will have no capabilities. This changes `input_manager_get_seat` to have an additional argument that dictates whether or not to create the seat if it does not exist.
This commit is contained in:
parent
8e60efe0bf
commit
7299b9a6ca
4 changed files with 13 additions and 9 deletions
|
|
@ -61,9 +61,10 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (strcmp(sc->name, "*") != 0) {
|
||||
struct sway_seat *seat = input_manager_get_seat(sc->name);
|
||||
struct sway_seat *seat = input_manager_get_seat(sc->name, false);
|
||||
if (!seat) {
|
||||
return cmd_results_new(CMD_FAILURE, "Failed to get seat");
|
||||
return cmd_results_new(CMD_FAILURE,
|
||||
"Seat %s does not exist", sc->name);
|
||||
}
|
||||
error = handle_command(seat->cursor, argc, argv);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue