Skip to content

Commit

Permalink
Revert "fix(config): Use interface number for seen devices. Don't for…
Browse files Browse the repository at this point in the history
…ce all interfaces to be present."

This reverts commit fef16b0.
  • Loading branch information
pastaq committed Mar 2, 2024
1 parent ea7c9bf commit fa47b1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ impl CompositeDeviceConfig {
let Some(hidraw_devices) = self.get_matching_hidraw()? else {
return Ok(true);
};
let hidraw_configs = self.get_hidraw_configs();

Ok(hidraw_devices.len() >= 1)
Ok(hidraw_devices.len() >= hidraw_configs.len())
}

/// Returns true if all the evdev source devices in the config exist on the system
Expand Down Expand Up @@ -205,12 +206,7 @@ impl CompositeDeviceConfig {

// Construct a device ID from the vendor and product to see
// if this device has already been matched.
let device_id = format!(
"{:04x}:{:04x}:{}",
device.vendor_id(),
device.product_id(),
device.interface_number()
);
let device_id = format!("{:04x}:{:04x}", device.vendor_id(), device.product_id());
if seen_devices.contains(&device_id) {
log::debug!("Device already seen: {}", device_id);
continue;
Expand Down
2 changes: 0 additions & 2 deletions src/input/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ impl Manager {
if let Err(e) = result {
log::error!("Unable to send command: {:?}", e);
}
break;
}

// Perform an initial event device discovery
Expand Down Expand Up @@ -676,7 +675,6 @@ impl Manager {
if let Err(e) = result {
log::error!("Unable to send command: {:?}", e);
}
break;
}

// Start a task to dispatch filesystem watch events to the `run()` loop
Expand Down

0 comments on commit fa47b1f

Please sign in to comment.