diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-03-15 12:46:57 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-03-15 12:46:57 +0000 |
commit | dec022ea93d6a120716f47efe1c5f4d4236e726b (patch) | |
tree | a240c85baaacbdf32aafe522a103abced121f083 /src | |
parent | 57e21d3708ad855333de53f31a3e1b0f93081dc2 (diff) | |
download | ayatana-indicator-sound-dec022ea93d6a120716f47efe1c5f4d4236e726b.tar.gz ayatana-indicator-sound-dec022ea93d6a120716f47efe1c5f4d4236e726b.tar.bz2 ayatana-indicator-sound-dec022ea93d6a120716f47efe1c5f4d4236e726b.zip |
ensure it observes a positive mute state at startup
Diffstat (limited to 'src')
-rw-r--r-- | src/slider-menu-item.c | 9 | ||||
-rw-r--r-- | src/volume-widget.c | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/slider-menu-item.c b/src/slider-menu-item.c index 9551b4b..974749f 100644 --- a/src/slider-menu-item.c +++ b/src/slider-menu-item.c @@ -76,7 +76,7 @@ slider_menu_item_init (SliderMenuItem *self) SliderMenuItemPrivate* priv = SLIDER_MENU_ITEM_GET_PRIVATE (self); - priv->index = -1; + priv->index = NOT_ACTIVE; priv->name = NULL; return; @@ -136,6 +136,11 @@ slider_menu_item_populate (SliderMenuItem* self, const pa_sink_info* update) dbusmenu_menuitem_property_set_variant (DBUSMENU_MENUITEM(self), DBUSMENU_VOLUME_MENUITEM_LEVEL, new_volume); + GVariant* new_mute_update = g_variant_new_int32 (update->mute); + dbusmenu_menuitem_property_set_variant (DBUSMENU_MENUITEM(self), + DBUSMENU_VOLUME_MENUITEM_MUTE, + new_mute_update); + slider_menu_item_enable (self, TRUE); } @@ -195,7 +200,7 @@ slider_menu_item_enable (SliderMenuItem* self, gboolean active) DBUSMENU_MENUITEM_PROP_ENABLED, active); if(active == FALSE){ - priv->index = -1; + priv->index = NOT_ACTIVE; if(priv->name != NULL){ g_free(priv->name); priv->name = NULL; diff --git a/src/volume-widget.c b/src/volume-widget.c index c947669..55e81b3 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -175,9 +175,15 @@ volume_widget_set_twin_item(VolumeWidget* self, G_CALLBACK(volume_widget_property_update), self); gdouble initial_level = g_variant_get_double (dbusmenu_menuitem_property_get_variant(twin_item, DBUSMENU_VOLUME_MENUITEM_LEVEL)); + gint initial_mute = g_variant_get_int32 (dbusmenu_menuitem_property_get_variant(twin_item, + DBUSMENU_VOLUME_MENUITEM_MUTE)); + //g_debug("volume_widget_set_twin_item initial level = %f", initial_level); GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider); GtkRange *range = (GtkRange*)slider; + if(initial_mute == 1){ + initial_level = 0; + } gtk_range_set_value(range, initial_level); update_accessible_desc(priv->indicator); } |