rpms/gnome-media/devel 0001-Fix-stream-volume-vs.-muted-status-problems.patch, NONE, 1.1 gnome-media.spec, 1.181, 1.182

Bastien Nocera hadess at fedoraproject.org
Tue Sep 22 13:09:57 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/gnome-media/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24504

Modified Files:
	gnome-media.spec 
Added Files:
	0001-Fix-stream-volume-vs.-muted-status-problems.patch 
Log Message:
* Tue Sep 22 2009 Bastien Nocera <bnocera at redhat.com> 2.28.0-2
- Fix problems with mute status handling in the applet and dialogue


0001-Fix-stream-volume-vs.-muted-status-problems.patch:
 gvc-channel-bar.c        |   30 +++++++++++++++++++-----------
 gvc-mixer-dialog.c       |    4 +++-
 gvc-stream-status-icon.c |   10 +++++++---
 3 files changed, 29 insertions(+), 15 deletions(-)

--- NEW FILE 0001-Fix-stream-volume-vs.-muted-status-problems.patch ---
>From bda054815bcb92c9bb269c4f6c282a6238c6b059 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Tue, 22 Sep 2009 13:57:04 +0100
Subject: [PATCH] Fix stream volume vs. muted status problems

We need to behave differently when we have and don't have a muted
button in the channel bar.

Only mute and unmute the channel bar on 0-level when we don't
show a mute button (status icon)

Tell front-ends of the value change when we switch between
the zero adjustment, and the normal one.

Don't unmute muted streams when raising the volume (dialogue)

Set the stream mute status before changing it in PA.

All this fixes the status icon's slider not unmuting streams, and
staying stuck to zero.

https://bugzilla.gnome.org/show_bug.cgi?id=595857
---
 gnome-volume-control/src/gvc-channel-bar.c        |   30 +++++++++++++-------
 gnome-volume-control/src/gvc-mixer-dialog.c       |    4 ++-
 gnome-volume-control/src/gvc-stream-status-icon.c |    9 +++++-
 3 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/gnome-volume-control/src/gvc-channel-bar.c b/gnome-volume-control/src/gvc-channel-bar.c
index a9794d3..bc53344 100644
--- a/gnome-volume-control/src/gvc-channel-bar.c
+++ b/gnome-volume-control/src/gvc-channel-bar.c
@@ -411,12 +411,14 @@ on_scale_button_release_event (GtkWidget      *widget,
 
         value = gtk_adjustment_get_value (adj);
 
-        /* this means the adjustment moved away from zero and
-          therefore we should unmute and set the volume. */
-        if (value > 0)
-                gvc_channel_bar_set_is_muted (bar, FALSE);
-        else
-                gvc_channel_bar_set_is_muted (bar, TRUE);
+        if (bar->priv->show_mute == FALSE) {
+                /* this means the adjustment moved away from zero and
+                 * therefore we should unmute and set the volume. */
+                if (value > 0)
+                        gvc_channel_bar_set_is_muted (bar, FALSE);
+                else
+                        gvc_channel_bar_set_is_muted (bar, TRUE);
+        }
 
         /* Play a sound! */
         ca_gtk_play_for_widget (GTK_WIDGET (bar), 0,
@@ -490,10 +492,12 @@ on_zero_adjustment_value_changed (GtkAdjustment *adjustment,
         value = gtk_adjustment_get_value (bar->priv->zero_adjustment);
         gtk_adjustment_set_value (bar->priv->adjustment, value);
 
-        /* this means the adjustment moved away from zero and
-          therefore we should unmute and set the volume. */
 
-        gvc_channel_bar_set_is_muted (bar, FALSE);
+        if (bar->priv->show_mute == FALSE) {
+                /* this means the adjustment moved away from zero and
+                 * therefore we should unmute and set the volume. */
+                gvc_channel_bar_set_is_muted (bar, value > 0.0);
+        }
 }
 
 static void
@@ -520,9 +524,11 @@ update_mute_button (GvcChannelBar *bar)
                         gtk_range_set_adjustment (GTK_RANGE (bar->priv->scale),
                                                   bar->priv->zero_adjustment);
                 } else {
-                        /* no longer muted so restore the original adjustment */
+                        /* no longer muted so restore the original adjustment
+                         * and tell the front-end that the value changed */
                         gtk_range_set_adjustment (GTK_RANGE (bar->priv->scale),
                                                   bar->priv->adjustment);
+                        gtk_adjustment_value_changed (bar->priv->adjustment);
                 }
         }
 }
@@ -534,9 +540,11 @@ gvc_channel_bar_set_is_muted (GvcChannelBar *bar,
         g_return_if_fail (GVC_IS_CHANNEL_BAR (bar));
 
         if (is_muted != bar->priv->is_muted) {
+                /* Update our internal state before telling the
+                 * front-end about our changes */
                 bar->priv->is_muted = is_muted;
-                g_object_notify (G_OBJECT (bar), "is-muted");
                 update_mute_button (bar);
+                g_object_notify (G_OBJECT (bar), "is-muted");
         }
 }
 
diff --git a/gnome-volume-control/src/gvc-mixer-dialog.c b/gnome-volume-control/src/gvc-mixer-dialog.c
index 0be5e33..ffeba97 100644
--- a/gnome-volume-control/src/gvc-mixer-dialog.c
+++ b/gnome-volume-control/src/gvc-mixer-dialog.c
@@ -659,7 +659,9 @@ on_adjustment_value_changed (GtkAdjustment  *adjustment,
                 g_free (name);
 
                 /* FIXME would need to do that in the balance bar really... */
-                gvc_mixer_stream_set_is_muted (stream, volume == 0);
+                /* Make sure we do not unmute muted streams, there's a button for that */
+                if (volume == 0.0)
+                        gvc_mixer_stream_set_is_muted (stream, TRUE);
                 /* Only push the volume if it's actually changed */
                 if (gvc_mixer_stream_set_volume(stream, (pa_volume_t) rounded) != FALSE)
                         gvc_mixer_stream_push_volume (stream);
diff --git a/gnome-volume-control/src/gvc-stream-status-icon.c b/gnome-volume-control/src/gvc-stream-status-icon.c
index 37131ea..9185f1a 100644
--- a/gnome-volume-control/src/gvc-stream-status-icon.c
+++ b/gnome-volume-control/src/gvc-stream-status-icon.c
@@ -617,8 +617,13 @@ on_bar_is_muted_notify (GObject             *object,
         gboolean is_muted;
 
         is_muted = gvc_channel_bar_get_is_muted (GVC_CHANNEL_BAR (object));
-        gvc_mixer_stream_change_is_muted (icon->priv->mixer_stream,
-                                          is_muted);
+
+        if (gvc_mixer_stream_get_is_muted (icon->priv->mixer_stream) != is_muted) {
+                /* Update the stream before pushing the change */
+                gvc_mixer_stream_set_is_muted (icon->priv->mixer_stream, is_muted);
+                gvc_mixer_stream_change_is_muted (icon->priv->mixer_stream,
+                                                  is_muted);
+        }
 }
 
 static GObject *
-- 
1.6.2.5



Index: gnome-media.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-media/devel/gnome-media.spec,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -p -r1.181 -r1.182
--- gnome-media.spec	21 Sep 2009 14:43:00 -0000	1.181
+++ gnome-media.spec	22 Sep 2009 13:09:57 -0000	1.182
@@ -14,10 +14,12 @@
 Summary:        GNOME media programs
 Name:           gnome-media
 Version:        2.28.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 License:        GPLv2+ and GFDL
 Group:          Applications/Multimedia
 Source:         http://download.gnome.org/sources/gnome-media/2.28/gnome-media-%{version}.tar.bz2
+# https://bugzilla.gnome.org/show_bug.cgi?id=595857
+Patch0:         0001-Fix-stream-volume-vs.-muted-status-problems.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes:      gnome
@@ -82,6 +84,7 @@ framework.
 
 %prep
 %setup -q
+%patch0 -p1 -b .mute
 
 # force regeneration
 rm profiles/gnome-audio-profiles.schemas
@@ -311,6 +314,9 @@ fi
 
 
 %changelog
+* Tue Sep 22 2009 Bastien Nocera <bnocera at redhat.com> 2.28.0-2
+- Fix problems with mute status handling in the applet and dialogue
+
 * Mon Sep 21 2009 Bastien Nocera <bnocera at redhat.com> 2.28.0-1
 - Update to 2.28.0
 




More information about the scm-commits mailing list