summaryrefslogtreecommitdiff
path: root/plugins/media-keys
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-04-06 02:51:59 -0700
committerStefano Karapetsas <[email protected]>2012-04-06 02:51:59 -0700
commitf2acd50eb2525f6970dc1cf0e05060d3d3cc135d (patch)
tree0a6d88c31e6bf3a2b103da9386590ee2d4a6d434 /plugins/media-keys
parentab589772234b8c89260bf10503df64bb2396070a (diff)
parentc96bc4ead7779af1617f505e1590ab8652242ad0 (diff)
downloadmate-settings-daemon-f2acd50eb2525f6970dc1cf0e05060d3d3cc135d.tar.bz2
mate-settings-daemon-f2acd50eb2525f6970dc1cf0e05060d3d3cc135d.tar.xz
Merge pull request #4 from benpicco/master
sync with upstream
Diffstat (limited to 'plugins/media-keys')
-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);