From 6d62a7175db8273274a76e2901babd3f68cae1df Mon Sep 17 00:00:00 2001 From: Ben Buhse Date: Wed, 11 Feb 2026 12:26:12 -0600 Subject: [PATCH] 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. --- src/LibinputDevice.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/LibinputDevice.zig b/src/LibinputDevice.zig index 6c902c1..3048fdc 100644 --- a/src/LibinputDevice.zig +++ b/src/LibinputDevice.zig @@ -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(); + } + } } }