diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-01-11 12:12:30 -0600 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-01-11 12:12:30 -0600 |
commit | d8da7cdced255ac430caa78b9e6d24d9476e76d8 (patch) | |
tree | 376066b4c491b77c72f3073918eec7cca8be8e65 /src/slider-menu-item.c | |
parent | 714c7c49776e8a341254a3e4297b465d181206cd (diff) | |
parent | 259057b02fe5c6b777a438331defa2dda628dfd2 (diff) | |
download | ayatana-indicator-sound-d8da7cdced255ac430caa78b9e6d24d9476e76d8.tar.gz ayatana-indicator-sound-d8da7cdced255ac430caa78b9e6d24d9476e76d8.tar.bz2 ayatana-indicator-sound-d8da7cdced255ac430caa78b9e6d24d9476e76d8.zip |
merged the dreaded gdbus port
Diffstat (limited to 'src/slider-menu-item.c')
-rw-r--r-- | src/slider-menu-item.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/slider-menu-item.c b/src/slider-menu-item.c index d0d2050..0f2f07b 100644 --- a/src/slider-menu-item.c +++ b/src/slider-menu-item.c @@ -39,7 +39,8 @@ static void slider_menu_item_class_init (SliderMenuItemClass *klass); static void slider_menu_item_init (SliderMenuItem *self); static void slider_menu_item_dispose (GObject *object); static void slider_menu_item_finalize (GObject *object); -static void handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp); +static void handle_event (DbusmenuMenuitem * mi, const gchar * name, + GVariant * value, guint timestamp); G_DEFINE_TYPE (SliderMenuItem, slider_menu_item, DBUSMENU_TYPE_MENUITEM); @@ -77,12 +78,29 @@ slider_menu_item_finalize (GObject *object) static void -handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp) +handle_event (DbusmenuMenuitem * mi, + const gchar * name, + GVariant * value, + guint timestamp) { gdouble volume_input = 0; - volume_input = g_value_get_double(value); - if (value != NULL) + /*g_debug ( "handle-event in the slider at the backend, input is of type %s", + g_variant_get_type_string(value));*/ + + 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); + } + + volume_input = g_variant_get_double(input); + if (value != NULL){ set_sink_volume(volume_input); + } + g_variant_unref (input); } |