diff options
-rw-r--r-- | src/slider-menu-item.c | 3 | ||||
-rw-r--r-- | src/sound-service-dbus.c | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/slider-menu-item.c b/src/slider-menu-item.c index d41ff85..64db277 100644 --- a/src/slider-menu-item.c +++ b/src/slider-menu-item.c @@ -86,8 +86,6 @@ handle_event (DbusmenuMenuitem * mi, GVariant* input = NULL; input = value; - g_variant_ref (input); - // Please note: Subject to change in future DBusmenu revisions if (g_variant_is_of_type(value, G_VARIANT_TYPE_VARIANT) == TRUE) { input = g_variant_get_variant(value); @@ -97,7 +95,6 @@ handle_event (DbusmenuMenuitem * mi, if (value != NULL){ set_sink_volume(volume_input); } - g_variant_unref (input); } void slider_menu_item_update (SliderMenuItem* item, diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 3ecca38..336ee1f 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -159,8 +159,9 @@ DbusmenuMenuitem* sound_service_dbus_create_root_item (SoundServiceDbus* self) priv->root_menuitem = dbusmenu_menuitem_new(); g_debug("Root ID: %d", dbusmenu_menuitem_get_id(priv->root_menuitem)); DbusmenuServer *server = dbusmenu_server_new(INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH); - dbusmenu_server_set_root(server, priv->root_menuitem); - establish_pulse_activities(self); + dbusmenu_server_set_root (server, priv->root_menuitem); + g_object_unref (priv->root_menuitem); + establish_pulse_activities (self); return priv->root_menuitem; } @@ -175,12 +176,15 @@ static void sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, priv->mute_menuitem = mute_menu_item_new ( mute_update, availability); dbusmenu_menuitem_child_append (priv->root_menuitem, mute_menu_item_get_button (priv->mute_menuitem)); - + g_object_unref (priv->mute_menuitem); + // Slider priv->volume_slider_menuitem = slider_menu_item_new ( availability, volume ); dbusmenu_menuitem_child_append (priv->root_menuitem, DBUSMENU_MENUITEM ( priv->volume_slider_menuitem )); + g_object_unref (priv->volume_slider__menuitem); // Separator + DbusmenuMenuitem* separator = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set( separator, DBUSMENU_MENUITEM_PROP_TYPE, @@ -195,6 +199,7 @@ static void sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, dbusmenu_menuitem_child_append(priv->root_menuitem, settings_mi); g_signal_connect(G_OBJECT(settings_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_sound_settings_dialog), NULL); + sound_service_dbus_determine_state (self, availability, mute_update, volume); } |