Comment 7 for bug 1381856

Revision history for this message
Hui Wang (hui.wang) wrote :

And about this problem "(Also the icon is not correct, which show a speaker instead of a mic)", it seems this is a unity-settings-daemon's bug. After apply the patch below, the problem disappeared.

Index: unity-settings-daemon-14.04.0+14.04.20140606/plugins/media-keys/gsd-media-keys-manager.c
===================================================================
--- unity-settings-daemon-14.04.0+14.04.20140606.orig/plugins/media-keys/gsd-media-keys-manager.c 2014-06-06 22:38:57.000000000 +0800
+++ unity-settings-daemon-14.04.0+14.04.20140606/plugins/media-keys/gsd-media-keys-manager.c 2014-11-04 17:49:37.189722571 +0800
@@ -257,6 +257,14 @@
         NULL
 };

+static const char *mic_volume_icons[] = {
+ "microphone-sensitivity-muted-symbolic",
+ "microphone-sensitivity-low-symbolic",
+ "microphone-sensitivity-medium-symbolic",
+ "microphone-sensitivity-high-symbolic",
+ NULL
+};
+
 static const char *brightness_icons[] = {
         "notification-display-brightness-off",
  "notification-display-brightness-low",
@@ -343,10 +351,13 @@
 static gboolean
 ubuntu_osd_notification_show_volume (GsdMediaKeysManager *manager,
                                      gint value,
- gboolean muted)
+ gboolean muted,
+ gboolean is_mic)
 {
+ const char **icons_name = is_mic ? mic_volume_icons : volume_icons;
+
         return ubuntu_osd_do_notification (&manager->priv->volume_notification,
- "volume", value, muted, volume_icons);
+ "volume", value, muted, icons_name);
 }

 static gboolean
@@ -1337,7 +1348,7 @@
         const GvcMixerStreamPort *port;
         const char *icon;

- if (ubuntu_osd_notification_show_volume (manager, vol, muted))
+ if (ubuntu_osd_notification_show_volume (manager, vol, muted, !GVC_IS_MIXER_SINK (stream)))
                 goto done;

         vol = CLAMP (vol, 0, 100);