aboutsummaryrefslogtreecommitdiff
path: root/src/transport-widget.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-06 19:30:48 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-06 19:30:48 +0100
commit066b6a521cbda456ffb8f25ff01e1dd7d127fdd2 (patch)
tree5d7d675750daf600208fc24fa6f87e7794be2926 /src/transport-widget.c
parent1a664a07c80b0af9cd49d58335dda39df0d7785e (diff)
downloadayatana-indicator-sound-066b6a521cbda456ffb8f25ff01e1dd7d127fdd2.tar.gz
ayatana-indicator-sound-066b6a521cbda456ffb8f25ff01e1dd7d127fdd2.tar.bz2
ayatana-indicator-sound-066b6a521cbda456ffb8f25ff01e1dd7d127fdd2.zip
events from transport bar now are sent on button release
Diffstat (limited to 'src/transport-widget.c')
-rw-r--r--src/transport-widget.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/transport-widget.c b/src/transport-widget.c
index 702b472..4e7ea9c 100644
--- a/src/transport-widget.c
+++ b/src/transport-widget.c
@@ -136,22 +136,12 @@ transport_widget_button_press_event (GtkWidget *menuitem,
GdkEventButton *event)
{
g_return_val_if_fail(IS_TRANSPORT_WIDGET(menuitem), FALSE);
-
TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE(TRANSPORT_WIDGET(menuitem));
-
- GtkWidget *parent;
-
- parent = gtk_widget_get_parent (GTK_WIDGET (menuitem));
-
+
PlayButtonEvent result = determine_button_event(priv->play_button, event);
if(result != TRANSPORT_NADA){
- GValue value = {0};
- g_value_init(&value, G_TYPE_INT);
- g_debug("TransportWidget::menu_press_event - going to send value %i", (int)result);
- g_value_set_int(&value, (int)result);
play_button_react_to_button_press(priv->play_button, result);
- dbusmenu_menuitem_handle_event (priv->twin_item, "Transport state change", &value, 0);
}
return TRUE;
}
@@ -164,8 +154,17 @@ transport_widget_button_release_event (GtkWidget *menuitem,
g_debug("TransportWidget::menu_release_event");
g_return_val_if_fail(IS_TRANSPORT_WIDGET(menuitem), FALSE);
TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE(TRANSPORT_WIDGET(menuitem));
- play_button_react_to_button_release(priv->play_button);
+ PlayButtonEvent result = determine_button_event(priv->play_button, event);
+
+ if(result != TRANSPORT_NADA){
+ GValue value = {0};
+ g_value_init(&value, G_TYPE_INT);
+ g_debug("TransportWidget::menu_press_event - going to send value %i", (int)result);
+ g_value_set_int(&value, (int)result);
+ play_button_react_to_button_release(priv->play_button, result);
+ dbusmenu_menuitem_handle_event (priv->twin_item, "Transport state change", &value, 0);
+ }
return TRUE;
}
@@ -187,6 +186,7 @@ transport_widget_property_update(DbusmenuMenuitem* item, gchar* property,
int update_value = g_value_get_int(value);
g_debug("transport_widget_update_state - with value %i", update_value);
play_button_toggle_play_pause(priv->play_button, (PlayButtonState)update_value);
+
}
}