summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRodrigo Moya <[email protected]>2011-04-19 15:59:35 +0200
committerBenjamin Valentin <[email protected]>2012-03-16 09:29:10 +0100
commit396265b9bf41b6331833a1938eb3e065e5928fe5 (patch)
tree36e5a412dec9851c0338c21b4b902e5ceef13e76 /plugins
parent3b1fa7dde9b8fc7fe0b22c9385703a2d150cd643 (diff)
downloadmate-settings-daemon-396265b9bf41b6331833a1938eb3e065e5928fe5.tar.bz2
mate-settings-daemon-396265b9bf41b6331833a1938eb3e065e5928fe5.tar.xz
media-keys: React to stream-removed signal from GvcMixerControl
Diffstat (limited to 'plugins')
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index d7e1b04..e7310c6 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -862,6 +862,19 @@ on_control_default_sink_changed (GvcMixerControl *control,
update_default_sink (manager);
}
+static void
+on_control_stream_removed (GvcMixerControl *control,
+ guint id,
+ GsdMediaKeysManager *manager)
+{
+ if (manager->priv->stream != NULL) {
+ if (gvc_mixer_stream_get_id (manager->priv->stream) == id) {
+ g_object_unref (manager->priv->stream);
+ manager->priv->stream = NULL;
+ }
+ }
+}
+
#endif /* HAVE_PULSE */
static gint
@@ -1186,6 +1199,10 @@ msd_media_keys_manager_start (MsdMediaKeysManager *manager,
"default-sink-changed",
G_CALLBACK (on_control_default_sink_changed),
manager);
+ g_signal_connect (manager->priv->volume,
+ "stream-removed",
+ G_CALLBACK (on_control_stream_removed),
+ manager);
gvc_mixer_control_open (manager->priv->volume);