1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-07-07 09:29:30 +00:00

ringer: Break loop if triggered event was ended immediately

When the only feedback of an event is unavailable on a system (e.g. no
vibration motor or LED) the "feedback-ended" signal is emitted
immediately and the end reason will be LFB_EVENT_END_REASON_NOT_FOUND.

In this case we need to change the target state, so that our logic does
not end up retriggering the event infinitely.
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-11-04 09:48:41 +01:00
parent e36f9b4e95
commit f96c9ded63

View file

@ -198,6 +198,12 @@ on_feedback_ended (LfbEvent *event,
return;
}
/* When no feedback is available on the system (e.g. no vibration motor or LEDs)
* it will get ended immediately on triggering. Changing the target state will
* break loop that would otherwise occur. */
if (lfb_event_get_end_reason (event) == LFB_EVENT_END_REASON_NOT_FOUND)
self->target_state = CALLS_RING_STATE_INACTIVE;
set_ring_state (self, CALLS_RING_STATE_INACTIVE);
}