diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-02-03 13:56:05 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-02-11 10:15:00 -0500 |
commit | 4272bf127439a2d8515e934821a9744537260b9d (patch) | |
tree | 30972bfd6f93afc9ac339b3ae89c1aedbe509c11 /sway/commands/seat/cursor.c | |
parent | Focus ws inactive node with focus_follows_mouse (diff) | |
download | sway-4272bf127439a2d8515e934821a9744537260b9d.tar.gz sway-4272bf127439a2d8515e934821a9744537260b9d.tar.zst sway-4272bf127439a2d8515e934821a9744537260b9d.zip |
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.
Diffstat (limited to 'sway/commands/seat/cursor.c')
-rw-r--r-- | sway/commands/seat/cursor.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/commands/seat/cursor.c b/sway/commands/seat/cursor.c index 4f805b22..0c7609ea 100644 --- a/sway/commands/seat/cursor.c +++ b/sway/commands/seat/cursor.c | |||
@@ -61,9 +61,10 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) { | |||
61 | } | 61 | } |
62 | 62 | ||
63 | if (strcmp(sc->name, "*") != 0) { | 63 | if (strcmp(sc->name, "*") != 0) { |
64 | struct sway_seat *seat = input_manager_get_seat(sc->name); | 64 | struct sway_seat *seat = input_manager_get_seat(sc->name, false); |
65 | if (!seat) { | 65 | if (!seat) { |
66 | return cmd_results_new(CMD_FAILURE, "Failed to get seat"); | 66 | return cmd_results_new(CMD_FAILURE, |
67 | "Seat %s does not exist", sc->name); | ||
67 | } | 68 | } |
68 | error = handle_command(seat->cursor, argc, argv); | 69 | error = handle_command(seat->cursor, argc, argv); |
69 | } else { | 70 | } else { |