Fix possible race in LibinputDevice.manage()

Only clear should_manage once the device is fully initialized (has an
associated input_device with a name). Previously, should_manage was
cleared unconditionally, so if manage_start fired before the device was
fully linked, configs would never be applied.
This commit is contained in:
Ben Buhse 2026-02-11 12:26:12 -06:00
commit 6d62a7175d
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4

View file

@ -166,8 +166,12 @@ fn riverLibinputDeviceV1Listener(river_libinput_device_v1: *river.LibinputDevice
pub fn manage(libinput_device: *LibinputDevice) void {
if (libinput_device.should_manage) {
libinput_device.should_manage = false;
libinput_device.applyInputConfigs();
if (libinput_device.input_device) |input_device| {
if (input_device.name) |_| {
libinput_device.should_manage = false;
libinput_device.applyInputConfigs();
}
}
}
}