aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-07-27 15:14:53 +0100
committerConor Curran <conor.curran@canonical.com>2010-07-27 15:14:53 +0100
commit694340cf4123edee2d3c22173c1ac855a6b187f7 (patch)
tree075bc2504e749a71dc52540adffd027547fe315a /src
parent91aa6c3f4cdf7fdf3c5b96fa9c24c6ba089c8c42 (diff)
downloadayatana-indicator-sound-694340cf4123edee2d3c22173c1ac855a6b187f7.tar.gz
ayatana-indicator-sound-694340cf4123edee2d3c22173c1ac855a6b187f7.tar.bz2
ayatana-indicator-sound-694340cf4123edee2d3c22173c1ac855a6b187f7.zip
lots of bits tidied up
Diffstat (limited to 'src')
-rw-r--r--src/play-button.c29
-rw-r--r--src/sound-service.c4
-rw-r--r--src/transport-widget.c2
3 files changed, 19 insertions, 16 deletions
diff --git a/src/play-button.c b/src/play-button.c
index cb09442..cf8bc2f 100644
--- a/src/play-button.c
+++ b/src/play-button.c
@@ -454,26 +454,29 @@ void
play_button_toggle_play_pause(GtkWidget* button, PlayButtonState update)
{
PlayButtonPrivate* priv = PLAY_BUTTON_GET_PRIVATE(button);
+ gboolean changed = priv->current_state != update;
priv->current_state = update;
g_debug("PlayButton::toggle play state : %i", priv->current_state);
- cairo_t *cr;
+ if(changed == TRUE){
+ g_debug("Toggle play pause - changed of state detected");
+ cairo_t *cr;
- cr = gdk_cairo_create (button->window);
+ cr = gdk_cairo_create (button->window);
- GList* list = g_hash_table_lookup(priv->command_coordinates,
- GINT_TO_POINTER(TRANSPORT_PLAY_PAUSE));
+ GList* list = g_hash_table_lookup(priv->command_coordinates,
+ GINT_TO_POINTER(TRANSPORT_PLAY_PAUSE));
- cairo_rectangle(cr,
- GPOINTER_TO_INT(g_list_nth_data(list, 0)),
- GPOINTER_TO_INT(g_list_nth_data(list, 1)),
- GPOINTER_TO_INT(g_list_nth_data(list, 2)),
- GPOINTER_TO_INT(g_list_nth_data(list, 3)));
-
- cairo_clip(cr);
- draw (button, cr);
- cairo_destroy (cr);
+ cairo_rectangle(cr,
+ GPOINTER_TO_INT(g_list_nth_data(list, 0)),
+ GPOINTER_TO_INT(g_list_nth_data(list, 1)),
+ GPOINTER_TO_INT(g_list_nth_data(list, 2)),
+ GPOINTER_TO_INT(g_list_nth_data(list, 3)));
+ cairo_clip(cr);
+ draw (button, cr);
+ cairo_destroy (cr);
+ }
}
diff --git a/src/sound-service.c b/src/sound-service.c
index 16fa87c..8768cd3 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -42,8 +42,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
if (mainloop != NULL) {
g_debug("Service shutdown !");
// TODO: uncomment for release !!
- //close_pulse_activites();
- //g_main_loop_quit(mainloop);
+ close_pulse_activites();
+ g_main_loop_quit(mainloop);
}
return;
}
diff --git a/src/transport-widget.c b/src/transport-widget.c
index 10a1fd7..535add2 100644
--- a/src/transport-widget.c
+++ b/src/transport-widget.c
@@ -152,8 +152,8 @@ transport_widget_button_press_event (GtkWidget *menuitem,
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_press(priv->play_button, result);
+ dbusmenu_menuitem_handle_event (priv->twin_item, "Transport state change", &value, 0);
}
return TRUE;
}