From 5bcbc0b4a95c8b9fe0f74fee9de59a8afbe401a6 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Thu, 15 Oct 2020 15:52:55 -0600 Subject: seat: use default output mapping if there is no input config --- sway/input/seat.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sway/input/seat.c') 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) { -- cgit v1.2.3