Merge lp:~hui.wang/unity-settings-daemon/unity-settings-daemon into lp:unity-settings-daemon

Proposed by Hui Wang
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 4061
Merged at revision: 4065
Proposed branch: lp:~hui.wang/unity-settings-daemon/unity-settings-daemon
Merge into: lp:unity-settings-daemon
Diff against target: 84 lines (+24/-19)
1 file modified
plugins/media-keys/gsd-media-keys-manager.c (+24/-19)
To merge this branch: bzr merge lp:~hui.wang/unity-settings-daemon/unity-settings-daemon
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
David Henningsson (community) Approve
Review via email: mp+240807@code.launchpad.net

Commit message

show correct microphone mute icon

Description of the change

We found a problem on the ubuntu 14.04 (trusty), and we think this problem exists on 14.10 and 15.04 as well.

The problem is when we press microphone mute hotkey, the OSD shows a speaker mute icon instead of microphone mute.

the tracking bug for this problem is: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1381856

To post a comment you must log in.
Revision history for this message
Hui Wang (hui.wang) wrote :

Forgot to mention, the microphone icons I used in the patch was installed by this package: gnome-icon-theme-symbolic.

Those icons will be installed by default and already be used in the gsd-media-keys-manager.c, so it is safe to use it again in this file.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the work, Ccing David who knows that code a bit better than me

David, could you comment on whether "GVC_IS_MIXER_SINK (stream)" is the right way to check if the right way to tell a mic appart from an output?

Revision history for this message
David Henningsson (diwic) wrote :

> David, could you comment on whether "GVC_IS_MIXER_SINK (stream)" is the right way to check if the right way to tell a mic appart from an output?

I suppose so, since it is already used that way a few lines down.

In short, assuming Hui has properly tested his patch, I see no problems with it.

Nitpick: perhaps get_icon_name_for_volume can now be refactored to use the global definitions of "icon_names" and "mic_icon_names" instead of copy-pasted local ones.

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

I have tested my patch on the machine whith the trusty installed. It worked very well.

And about the Nitpick mentioned by David, if you want me to do the change, just let me know. Or probably you can do the change by yourself when you merge it.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Hui, could you do the nitpick change? we can as well fix that before merging in. thanks!

4061. By Hui Wang

change to use global variables in the get_icon_name_for_volume

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

Done, the commit 4061 is for nitpick.

Revision history for this message
Anthony Wong (anthonywong) wrote :

Seb, we need this fix for oem projects, could you review this patch at your earliest convenience?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Sorry for the delay due to holidays, the change looks fine indeed

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

Hi Sebastien,

Is it possible to merge this fix to Trusty, we have an OEM bug #1389099
still waiting this fix to be merged to Trusty, if you need me to do
something, please let me know.

Regards,
Hui.

On 01/08/2015 12:54 AM, Sebastien Bacher wrote:
> The proposal to merge lp:~hui.wang/unity-settings-daemon/unity-settings-daemon into lp:unity-settings-daemon has been updated.
>
> Commit Message changed to:
>
> show correct microphone mute icon
>
> For more details, see:
> https://code.launchpad.net/~hui.wang/unity-settings-daemon/unity-settings-daemon/+merge/240807

Revision history for this message
Sebastien Bacher (seb128) wrote :

Le 13/01/2015 03:16, Hui Wang a écrit :
> Hi Sebastien,
>
> Is it possible to merge this fix to Trusty,

Hey Hui,

Yes, I was waiting to get some feedback from the upload to vivid, I'm
going to SRU it next

Cheers,
Sebastien Bacher

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

Got it, thanks.

On 01/14/2015 10:08 PM, Sebastien Bacher wrote:
> Le 13/01/2015 03:16, Hui Wang a écrit :
>> Hi Sebastien,
>>
>> Is it possible to merge this fix to Trusty,
> Hey Hui,
>
> Yes, I was waiting to get some feedback from the upload to vivid, I'm
> going to SRU it next
>
> Cheers,
> Sebastien Bacher
>

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

Hello Sebastien,

Our OEM project has been waiting this fix to be merged to Trusty (14.04)
, is it possible we do that now? If you need me to do something, just
let me know.

Thanks,
Hui.

On 01/14/2015 10:09 PM, Sebastien Bacher wrote:
> Le 13/01/2015 03:16, Hui Wang a écrit :
>> Hi Sebastien,
>>
>> Is it possible to merge this fix to Trusty,
> Hey Hui,
>
> Yes, I was waiting to get some feedback from the upload to vivid, I'm
> going to SRU it next
>
> Cheers,
> Sebastien Bacher
>

Revision history for this message
Sebastien Bacher (seb128) wrote :

Hey Hui,

We could probably SRU it now, there are some issues though like [1] the
fact that indicator menus are misplaced on the greeter when hidpi
scaling on. We could have a first SRU to try to activate it only for the
installer/oem config (we just need to find e.g an env variable specific
to those sessions) or wait to have a fix for the unity-greeter issue and
SRU that as well.
Do you have a preference for one of those options?

Cheers,
Sebastien Bacher

[1] https://bugs.launchpad.net/ubuntu/+source/unity-greeter/+bug/1434094

Le 25/03/2015 07:37, Hui Wang a écrit :
> Hello Sebastien,
>
> Our OEM project has been waiting this fix to be merged to Trusty
> (14.04) , is it possible we do that now? If you need me to do
> something, just let me know.
>
>
> Thanks,
> Hui.

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

Hello Seb,

The option 2 is fine, it is best that two fixes to be SRUed together. :-)

Thanks,
Hui.

On 03/25/2015 04:07 PM, Sebastien Bacher wrote:
> Hey Hui,
>
> We could probably SRU it now, there are some issues though like [1] the
> fact that indicator menus are misplaced on the greeter when hidpi
> scaling on. We could have a first SRU to try to activate it only for the
> installer/oem config (we just need to find e.g an env variable specific
> to those sessions) or wait to have a fix for the unity-greeter issue and
> SRU that as well.
> Do you have a preference for one of those options?
>
> Cheers,
> Sebastien Bacher
>
> [1] https://bugs.launchpad.net/ubuntu/+source/unity-greeter/+bug/1434094
>
> Le 25/03/2015 07:37, Hui Wang a écrit :
>> Hello Sebastien,
>>
>> Our OEM project has been waiting this fix to be merged to Trusty
>> (14.04) , is it possible we do that now? If you need me to do
>> something, just let me know.
>>
>>
>> Thanks,
>> Hui.
>
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
2--- plugins/media-keys/gsd-media-keys-manager.c 2014-03-04 10:49:56 +0000
3+++ plugins/media-keys/gsd-media-keys-manager.c 2014-12-03 02:43:22 +0000
4@@ -257,6 +257,22 @@
5 NULL
6 };
7
8+static const char *audio_volume_icons[] = {
9+ "audio-volume-muted-symbolic",
10+ "audio-volume-low-symbolic",
11+ "audio-volume-medium-symbolic",
12+ "audio-volume-high-symbolic",
13+ NULL
14+};
15+
16+static const char *mic_volume_icons[] = {
17+ "microphone-sensitivity-muted-symbolic",
18+ "microphone-sensitivity-low-symbolic",
19+ "microphone-sensitivity-medium-symbolic",
20+ "microphone-sensitivity-high-symbolic",
21+ NULL
22+};
23+
24 static const char *brightness_icons[] = {
25 "notification-display-brightness-off",
26 "notification-display-brightness-low",
27@@ -343,10 +359,13 @@
28 static gboolean
29 ubuntu_osd_notification_show_volume (GsdMediaKeysManager *manager,
30 gint value,
31- gboolean muted)
32+ gboolean muted,
33+ gboolean is_mic)
34 {
35+ const char **icons_name = is_mic ? mic_volume_icons : volume_icons;
36+
37 return ubuntu_osd_do_notification (&manager->priv->volume_notification,
38- "volume", value, muted, volume_icons);
39+ "volume", value, muted, icons_name);
40 }
41
42 static gboolean
43@@ -606,20 +625,6 @@
44 gboolean muted,
45 int volume)
46 {
47- static const char *icon_names[] = {
48- "audio-volume-muted-symbolic",
49- "audio-volume-low-symbolic",
50- "audio-volume-medium-symbolic",
51- "audio-volume-high-symbolic",
52- NULL
53- };
54- static const char *mic_icon_names[] = {
55- "microphone-sensitivity-muted-symbolic",
56- "microphone-sensitivity-low-symbolic",
57- "microphone-sensitivity-medium-symbolic",
58- "microphone-sensitivity-high-symbolic",
59- NULL
60- };
61 int n;
62
63 if (muted) {
64@@ -635,9 +640,9 @@
65 }
66
67 if (is_mic)
68- return mic_icon_names[n];
69+ return mic_volume_icons[n];
70 else
71- return icon_names[n];
72+ return audio_volume_icons[n];
73 }
74
75 static gboolean
76@@ -1337,7 +1342,7 @@
77 const GvcMixerStreamPort *port;
78 const char *icon;
79
80- if (ubuntu_osd_notification_show_volume (manager, vol, muted))
81+ if (ubuntu_osd_notification_show_volume (manager, vol, muted, !GVC_IS_MIXER_SINK (stream)))
82 goto done;
83
84 vol = CLAMP (vol, 0, 100);

Subscribers

People subscribed via source and target branches