Fix capability update

This commit is contained in:
Drakulix 2017-04-15 19:20:53 +02:00
parent 0980f8a66c
commit 4f3a140543
1 changed files with 3 additions and 3 deletions

View File

@ -107,9 +107,9 @@ impl InputBackend for LibinputInputBackend {
// update capabilities, so they appear correctly on `on_seat_changed` and `on_seat_destroyed`. // update capabilities, so they appear correctly on `on_seat_changed` and `on_seat_destroyed`.
if let Some(seat) = self.seats.get_mut(&device_seat) { if let Some(seat) = self.seats.get_mut(&device_seat) {
let caps = seat.capabilities_mut(); let caps = seat.capabilities_mut();
caps.pointer = self.devices.iter().any(|x| x.has_capability(DeviceCapability::Pointer)); caps.pointer = self.devices.iter().filter(|x| x.seat() == device_seat).any(|x| x.has_capability(DeviceCapability::Pointer));
caps.keyboard = self.devices.iter().any(|x| x.has_capability(DeviceCapability::Keyboard)); caps.keyboard = self.devices.iter().filter(|x| x.seat() == device_seat).any(|x| x.has_capability(DeviceCapability::Keyboard));
caps.touch = self.devices.iter().any(|x| x.has_capability(DeviceCapability::Touch)); caps.touch = self.devices.iter().filter(|x| x.seat() == device_seat).any(|x| x.has_capability(DeviceCapability::Touch));
} else { } else {
panic!("Seat changed that was never created") panic!("Seat changed that was never created")
} }