aboutsummaryrefslogtreecommitdiff
path: root/src/transport-widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport-widget.c')
-rw-r--r--src/transport-widget.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/transport-widget.c b/src/transport-widget.c
index 702b472..979f6fd 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,7 +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);
+ dbusmenu_menuitem_handle_event (priv->twin_item, "Transport state change", &value, 0);
+ }
+ play_button_react_to_button_release(priv->play_button, result);
return TRUE;
}
@@ -187,6 +187,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);
+
}
}