mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-15 12:55:36 +00:00
call-display: switch to default audio profile only if no other call
Currently, when any call is terminated, audio profile/routing is switched to the default one. This is a problem when already into a call and getting a second one: rejecting the new call will keep the first one going, but with the wrong audio profile, making it difficult (or, on the PinePhone, impossible) to keep talking. This patch makes sure there is no other ongoing call before switching the audio mode, so that it's possible to keep the first call going even after rejecting the second one.
This commit is contained in:
parent
71f9e636b3
commit
5375ebbc72
1 changed files with 9 additions and 3 deletions
|
@ -228,6 +228,7 @@ call_state_changed_cb (CallsCallDisplay *self,
|
||||||
CallsCallState state)
|
CallsCallState state)
|
||||||
{
|
{
|
||||||
GtkStyleContext *hang_up_style;
|
GtkStyleContext *hang_up_style;
|
||||||
|
g_autoptr (GList) calls_list = NULL;
|
||||||
|
|
||||||
g_return_if_fail (CALLS_IS_CALL_DISPLAY (self));
|
g_return_if_fail (CALLS_IS_CALL_DISPLAY (self));
|
||||||
|
|
||||||
|
@ -269,9 +270,14 @@ call_state_changed_cb (CallsCallDisplay *self,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CALLS_CALL_STATE_DISCONNECTED:
|
case CALLS_CALL_STATE_DISCONNECTED:
|
||||||
|
calls_list = calls_manager_get_calls (calls_manager_get_default ());
|
||||||
|
/* Switch to default mode only if there's no other ongoing call */
|
||||||
|
if (!calls_list || (calls_list->data == self->call && !calls_list->next))
|
||||||
|
{
|
||||||
call_audio_select_mode_async (CALL_AUDIO_MODE_DEFAULT,
|
call_audio_select_mode_async (CALL_AUDIO_MODE_DEFAULT,
|
||||||
select_mode_complete,
|
select_mode_complete,
|
||||||
NULL);
|
NULL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue