diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2020-10-15 15:52:55 -0600 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-10-16 18:34:09 +0200 |
commit | 5bcbc0b4a95c8b9fe0f74fee9de59a8afbe401a6 (patch) | |
tree | 181f8885b2f1df77bfb8dc33788ce26a9002304e /sway/input/seat.c | |
parent | d6ac30753ded44c5f1921a3bbccb5856d5ef6539 (diff) |
seat: use default output mapping if there is no input config
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 32b496ce..04b480d8 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -660,17 +660,16 @@ static void seat_apply_input_config(struct sway_seat *seat, struct sway_seat_device *sway_device) { struct input_config *ic = input_device_get_config(sway_device->input_device); - if (ic == NULL) { - return; - } sway_log(SWAY_DEBUG, "Applying input config to %s", sway_device->input_device->identifier); - const char *mapped_to_output = ic->mapped_to_output; - struct wlr_box *mapped_to_region = ic->mapped_to_region; + const char *mapped_to_output = ic == NULL ? NULL : ic->mapped_to_output; + struct wlr_box *mapped_to_region = ic == NULL ? NULL : ic->mapped_to_region; + enum input_config_mapped_to mapped_to = + ic == NULL ? MAPPED_TO_DEFAULT : ic->mapped_to; - switch (ic->mapped_to) { + switch (mapped_to) { case MAPPED_TO_DEFAULT: mapped_to_output = sway_device->input_device->wlr_device->output_name; if (mapped_to_output == NULL) { |