diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-09 09:28:41 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-09 09:28:41 +0400 |
| commit | 475d6e4be177b74c23ba225d7cdf6ec30826a374 (patch) | |
| tree | 34a15788e796b2a53eae1eb897d8220126c6380a | |
| parent | d9e27988a7cecfe80156bea76119c9c15171fc52 (diff) | |
| download | niri-475d6e4be177b74c23ba225d7cdf6ec30826a374.tar.gz niri-475d6e4be177b74c23ba225d7cdf6ec30826a374.tar.bz2 niri-475d6e4be177b74c23ba225d7cdf6ec30826a374.zip | |
Extract tablet_seat and desc variables
| -rw-r--r-- | src/input.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/input.rs b/src/input.rs index 3b7e4dab..292d08bc 100644 --- a/src/input.rs +++ b/src/input.rs @@ -119,10 +119,10 @@ impl State { fn on_device_added(&mut self, device: impl Device) { if device.has_capability(DeviceCapability::TabletTool) { - self.niri - .seat - .tablet_seat() - .add_tablet::<Self>(&self.niri.display_handle, &TabletDescriptor::from(&device)); + let tablet_seat = self.niri.seat.tablet_seat(); + + let desc = TabletDescriptor::from(&device); + tablet_seat.add_tablet::<Self>(&self.niri.display_handle, &desc); } } @@ -130,7 +130,8 @@ impl State { if device.has_capability(DeviceCapability::TabletTool) { let tablet_seat = self.niri.seat.tablet_seat(); - tablet_seat.remove_tablet(&TabletDescriptor::from(&device)); + let desc = TabletDescriptor::from(&device); + tablet_seat.remove_tablet(&desc); // If there are no tablets in seat we can remove all tools if tablet_seat.count_tablets() == 0 { |
