From 9d99bb956fea8922f8e0196d67eabbd510c53f1f Mon Sep 17 00:00:00 2001 From: Yaroslav de la Peña Smirnov Date: Sun, 23 Oct 2022 03:09:38 +0300 Subject: Fix keymap being NULL and segfaulting on dev add Moved `libinput_config` to the callers of `sway_input_configure_libinput_device` so that we send the event after the added event. --- sway/input/libinput.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sway/input/libinput.c') diff --git a/sway/input/libinput.c b/sway/input/libinput.c index 3c0f359d..1bac72c9 100644 --- a/sway/input/libinput.c +++ b/sway/input/libinput.c @@ -187,10 +187,10 @@ static bool set_calibration_matrix(struct libinput_device *dev, float mat[6]) { return changed; } -void sway_input_configure_libinput_device(struct sway_input_device *input_device) { +bool sway_input_configure_libinput_device(struct sway_input_device *input_device) { struct input_config *ic = input_device_get_config(input_device); if (!ic || !wlr_input_device_is_libinput(input_device->wlr_device)) { - return; + return false; } struct libinput_device *device = @@ -259,9 +259,7 @@ void sway_input_configure_libinput_device(struct sway_input_device *input_device changed |= set_calibration_matrix(device, ic->calibration_matrix.matrix); } - if (changed) { - ipc_event_input("libinput_config", input_device); - } + return changed; } void sway_input_reset_libinput_device(struct sway_input_device *input_device) { -- cgit v1.2.3