eis: allow pausing the device when it is emulating

The whole point of pausing a device is to terminate the client's ability
to send events.

Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/367>
This commit is contained in:
Peter Hutterer 2025-12-15 09:15:33 +10:00
parent fe47a0a1f7
commit 73ec8dee9f

View file

@ -1437,8 +1437,13 @@ eis_device_pause(struct eis_device *device)
{
struct eis_client *client = eis_device_get_client(device);
if (device->state != EIS_DEVICE_STATE_RESUMED)
return;
switch (device->state) {
case EIS_DEVICE_STATE_RESUMED:
case EIS_DEVICE_STATE_EMULATING:
break;
default:
return;
}
device->state = EIS_DEVICE_STATE_PAUSED;
eis_device_event_paused(device, eis_client_get_next_serial(client));