mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-17 07:46:03 +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:
parent
e52f327aae
commit
e1f0b83d25
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue