Merge lp:~lukas-kde/indicator-sound/fixUnity8MuteNotification into lp:indicator-sound/15.10

Proposed by Lukáš Tinkl
Status: Needs review
Proposed branch: lp:~lukas-kde/indicator-sound/fixUnity8MuteNotification
Merge into: lp:indicator-sound/15.10
Diff against target: 41 lines (+7/-3)
1 file modified
src/service.vala (+7/-3)
To merge this branch: bzr merge lp:~lukas-kde/indicator-sound/fixUnity8MuteNotification
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+266459@code.launchpad.net

Commit message

Send a notification also in the case of mute/unmute events

Description of the change

Update and send a notification also in the case of mute/unmute events. Unity 8 on the desktop lacks this notification otherwise.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

Unity 7 shows notifications for mute/unmute. What's different in 8 to make this necessary?

Revision history for this message
Ted Gould (ted) wrote :

Looks fine to me.

Revision history for this message
Ted Gould (ted) wrote :

The difference is that in U8 the shell passes the events to indicator-sound where in U7 they're handled via X to G-S-D who gives them to Pulse Audio, and Indicator Sound responds to the Pulse Audio signaling.

Revision history for this message
Lars Karlitski (larsu) wrote :

Hm, this means that we're sending two notifications on unity7 now, one from unity-settings-daemon and one from indicator-sound. This doesn't result in a visual problem (notify-osd ignores the second notification), but it smells bad and causes unnecessary bus traffic. Please also update unity-control-center in the same landing.

Also, running this branch gives me a "volume muted" bubble when indicator-sound is started, but only when sound is not muted.

review: Needs Fixing

Unmerged revisions

499. By Lukáš Tinkl

send a proper notification when muting/unmuting the sound

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/service.vala'
2--- src/service.vala 2015-04-20 21:02:32 +0000
3+++ src/service.vala 2015-07-30 19:01:10 +0000
4@@ -245,7 +245,7 @@
5 if (this.volume_control.mute)
6 icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
7 else if (this.accounts_service != null && this.accounts_service.silentMode)
8- icon = "audio-volume-muted-panel";
9+ icon = "audio-volume-muted-panel";
10 else if (volume <= 0.0)
11 icon = "audio-volume-low-zero-panel";
12 else if (volume <= 0.3)
13@@ -302,7 +302,7 @@
14
15 /* Choose an icon */
16 string icon = "audio-volume-muted";
17- if (volume_control.volume.volume <= 0.0)
18+ if (volume_control.volume.volume <= 0.0 || volume_control.mute)
19 icon = "audio-volume-muted";
20 else if (volume_control.volume.volume <= 0.3)
21 icon = "audio-volume-low";
22@@ -319,7 +319,10 @@
23 /* Put it all into the notification */
24 sync_notification.clear_hints ();
25 sync_notification.update (_("Volume"), volume_label, icon);
26- sync_notification.set_hint ("value", (int32)Math.round(volume_control.volume.volume / this.max_volume * 100.0));
27+ if (volume_control.mute)
28+ sync_notification.set_hint ("value", (int32)0);
29+ else
30+ sync_notification.set_hint ("value", (int32)Math.round(volume_control.volume.volume / this.max_volume * 100.0));
31 sync_notification.set_hint ("x-canonical-value-bar-tint", tint);
32 sync_notification.set_hint ("x-canonical-private-synchronous", "true");
33 sync_notification.set_hint ("x-canonical-non-shaped-icon", "true");
34@@ -378,6 +381,7 @@
35 this.volume_control.notify["mute"].connect ( () => {
36 mute_action.set_state (new Variant.boolean (this.volume_control.mute));
37 this.update_root_icon ();
38+ this.update_sync_notification ();
39 });
40
41 this.volume_control.notify["is-playing"].connect( () => {

Subscribers

People subscribed via source and target branches