diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2022-10-23 03:09:38 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-10-23 11:56:29 +0200 |
commit | 9d99bb956fea8922f8e0196d67eabbd510c53f1f (patch) | |
tree | 446b69802f7a1278710bb90d56f017d2d29ff439 /sway/input/libinput.c | |
parent | input: tweak focus behavior to allow focusing parent containers (diff) | |
download | sway-9d99bb956fea8922f8e0196d67eabbd510c53f1f.tar.gz sway-9d99bb956fea8922f8e0196d67eabbd510c53f1f.tar.zst sway-9d99bb956fea8922f8e0196d67eabbd510c53f1f.zip |
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.
Diffstat (limited to 'sway/input/libinput.c')
-rw-r--r-- | sway/input/libinput.c | 8 |
1 files changed, 3 insertions, 5 deletions
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]) { | |||
187 | return changed; | 187 | return changed; |
188 | } | 188 | } |
189 | 189 | ||
190 | void sway_input_configure_libinput_device(struct sway_input_device *input_device) { | 190 | bool sway_input_configure_libinput_device(struct sway_input_device *input_device) { |
191 | struct input_config *ic = input_device_get_config(input_device); | 191 | struct input_config *ic = input_device_get_config(input_device); |
192 | if (!ic || !wlr_input_device_is_libinput(input_device->wlr_device)) { | 192 | if (!ic || !wlr_input_device_is_libinput(input_device->wlr_device)) { |
193 | return; | 193 | return false; |
194 | } | 194 | } |
195 | 195 | ||
196 | struct libinput_device *device = | 196 | struct libinput_device *device = |
@@ -259,9 +259,7 @@ void sway_input_configure_libinput_device(struct sway_input_device *input_device | |||
259 | changed |= set_calibration_matrix(device, ic->calibration_matrix.matrix); | 259 | changed |= set_calibration_matrix(device, ic->calibration_matrix.matrix); |
260 | } | 260 | } |
261 | 261 | ||
262 | if (changed) { | 262 | return changed; |
263 | ipc_event_input("libinput_config", input_device); | ||
264 | } | ||
265 | } | 263 | } |
266 | 264 | ||
267 | void sway_input_reset_libinput_device(struct sway_input_device *input_device) { | 265 | void sway_input_reset_libinput_device(struct sway_input_device *input_device) { |