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:
parent
296f875993
commit
6d62a7175d
1 changed files with 6 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue