Only auto-stop emulating if sender

This commit is contained in:
Jonas Ådahl 2022-05-02 06:46:18 +00:00 committed by Peter Hutterer
parent 425c7804d4
commit 4c874469d5
2 changed files with 4 additions and 2 deletions

View file

@ -239,7 +239,8 @@ ei_device_close(struct ei_device *device)
case EI_DEVICE_STATE_REMOVED_FROM_SERVER:
break;
case EI_DEVICE_STATE_EMULATING:
ei_send_stop_emulating(device);
if (ei_is_sender(ei_device_get_context(device)))
ei_send_stop_emulating(device);
_fallthrough_;
case EI_DEVICE_STATE_PAUSED:
case EI_DEVICE_STATE_RESUMED:

View file

@ -886,7 +886,8 @@ eis_device_closed_by_client(struct eis_device *device)
/* libei bug, ignore */
break;
case EIS_DEVICE_STATE_EMULATING:
eis_queue_device_stop_emulating_event(device);
if (!eis_client_is_sender(eis_device_get_client(device)))
eis_queue_device_stop_emulating_event(device);
_fallthrough_;
case EIS_DEVICE_STATE_NEW:
case EIS_DEVICE_STATE_PAUSED: