diff options
author | Sjoerd Simons <sjoerd@luon.net> | 2012-05-21 18:16:49 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd@luon.net> | 2012-05-21 19:54:00 +0800 |
commit | d524cc36152688f8475f14eb2bfd17bcb1e34b3f (patch) | |
tree | d055e56e6d804bdb2ab0f455acfc6251cea0d153 /src | |
parent | 9f1691878cc95951039eb2d7a47b6462569da299 (diff) | |
download | gsoc2013-empathy-d524cc36152688f8475f14eb2bfd17bcb1e34b3f.tar gsoc2013-empathy-d524cc36152688f8475f14eb2bfd17bcb1e34b3f.tar.gz gsoc2013-empathy-d524cc36152688f8475f14eb2bfd17bcb1e34b3f.tar.bz2 gsoc2013-empathy-d524cc36152688f8475f14eb2bfd17bcb1e34b3f.tar.lz gsoc2013-empathy-d524cc36152688f8475f14eb2bfd17bcb1e34b3f.tar.xz gsoc2013-empathy-d524cc36152688f8475f14eb2bfd17bcb1e34b3f.tar.zst gsoc2013-empathy-d524cc36152688f8475f14eb2bfd17bcb1e34b3f.zip |
call: Keep the toolbar around if muted
It's not uncommon for people to forget that the put a call on mute,
causing awkward situation while trying to talk while muted. To
prevent this, keep the toolbar showhing while muted as a reminder.
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-call-window.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 67b1aea0b..01181c40b 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -275,6 +275,8 @@ struct _EmpathyCallWindowPriv GSettings *settings; EmpathyMicMenu *mic_menu; EmpathyCameraMenu *camera_menu; + + gboolean muted; }; #define GET_PRIV(o) (EMPATHY_CALL_WINDOW (o)->priv) @@ -324,6 +326,8 @@ static void empathy_call_window_status_message (EmpathyCallWindow *window, static gboolean empathy_call_window_bus_message (GstBus *bus, GstMessage *message, gpointer user_data); +static gboolean empathy_call_window_update_timer (gpointer user_data); + static void make_background_transparent (GtkClutterActor *actor) { @@ -462,6 +466,20 @@ element_volume_to_audio_control (GBinding *binding, } static void +audio_input_mute_notify_cb (GObject *obj, GParamSpec *spec, + EmpathyCallWindow *self) +{ + gboolean muted; + g_object_get (obj, "mute", &muted, NULL); + + self->priv->muted = muted; + if (muted && self->priv->transitions) + clutter_state_set_state (self->priv->transitions, "fade-in"); + + empathy_call_window_update_timer (self); +} + +static void create_audio_input (EmpathyCallWindow *self) { EmpathyCallWindowPriv *priv = GET_PRIV (self); @@ -470,10 +488,14 @@ create_audio_input (EmpathyCallWindow *self) priv->audio_input = empathy_audio_src_new (); gst_object_ref_sink (priv->audio_input); + g_signal_connect (priv->audio_input, "notify::mute", + G_CALLBACK (audio_input_mute_notify_cb), self); + g_object_bind_property (priv->mic_button, "active", priv->audio_input, "mute", G_BINDING_BIDIRECTIONAL | G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE); + } static void @@ -1359,9 +1381,11 @@ empathy_call_window_toolbar_timeout (gpointer data) EmpathyCallWindow *self = data; /* We don't want to hide the toolbar if we're not in a call, as - * to show the call status all the time. */ + * to show the call status all the time. Also don't hide if we're muted + * to prevent the awkward, talking when muted situation */ if (self->priv->call_state != CONNECTING && - self->priv->call_state != DISCONNECTED) + self->priv->call_state != DISCONNECTED && + !self->priv->muted) clutter_state_set_state (self->priv->transitions, "fade-out"); return TRUE; |