mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 19:00:14 +01:00
evdev: factor out closing a device into evdev_suspend()
No functional changes, just prep work for an upcoming patch Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
9f2b05d5ac
commit
702e8db2cf
2 changed files with 13 additions and 2 deletions
13
src/evdev.c
13
src/evdev.c
|
|
@ -1165,8 +1165,8 @@ release_pressed_keys(struct evdev_device *device)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
evdev_device_remove(struct evdev_device *device)
|
||||
int
|
||||
evdev_device_suspend(struct evdev_device *device)
|
||||
{
|
||||
if (device->source)
|
||||
libinput_remove_source(device->base.seat->libinput,
|
||||
|
|
@ -1178,6 +1178,15 @@ evdev_device_remove(struct evdev_device *device)
|
|||
mtdev_close_delete(device->mtdev);
|
||||
close_restricted(device->base.seat->libinput, device->fd);
|
||||
device->fd = -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
evdev_device_remove(struct evdev_device *device)
|
||||
{
|
||||
evdev_device_suspend(device);
|
||||
|
||||
list_remove(&device->base.link);
|
||||
|
||||
notify_removed_device(&device->base);
|
||||
|
|
|
|||
|
|
@ -186,6 +186,8 @@ double
|
|||
evdev_device_transform_y(struct evdev_device *device,
|
||||
double y,
|
||||
uint32_t height);
|
||||
int
|
||||
evdev_device_suspend(struct evdev_device *device);
|
||||
|
||||
void
|
||||
evdev_keyboard_notify_key(struct evdev_device *device,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue