From 4f3a140543856f6172981b0ae5aec8e89e3aa265 Mon Sep 17 00:00:00 2001 From: Drakulix Date: Sat, 15 Apr 2017 19:20:53 +0200 Subject: [PATCH] Fix capability update --- src/backend/libinput.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/libinput.rs b/src/backend/libinput.rs index 63befc6..2ff3999 100644 --- a/src/backend/libinput.rs +++ b/src/backend/libinput.rs @@ -107,9 +107,9 @@ impl InputBackend for LibinputInputBackend { // update capabilities, so they appear correctly on `on_seat_changed` and `on_seat_destroyed`. if let Some(seat) = self.seats.get_mut(&device_seat) { let caps = seat.capabilities_mut(); - caps.pointer = self.devices.iter().any(|x| x.has_capability(DeviceCapability::Pointer)); - caps.keyboard = self.devices.iter().any(|x| x.has_capability(DeviceCapability::Keyboard)); - caps.touch = self.devices.iter().any(|x| x.has_capability(DeviceCapability::Touch)); + caps.pointer = self.devices.iter().filter(|x| x.seat() == device_seat).any(|x| x.has_capability(DeviceCapability::Pointer)); + caps.keyboard = self.devices.iter().filter(|x| x.seat() == device_seat).any(|x| x.has_capability(DeviceCapability::Keyboard)); + caps.touch = self.devices.iter().filter(|x| x.seat() == device_seat).any(|x| x.has_capability(DeviceCapability::Touch)); } else { panic!("Seat changed that was never created") }