diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-11-17 15:34:27 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-11-17 15:34:27 +0000 |
commit | 237041021ddb7d0c08542fbdca41d845b14dea82 (patch) | |
tree | 807f0748ed1af6a9f482356d1c24742346ca1ba6 /src/transport-widget.c | |
parent | ca946b13d56c7df56d30c8824baf8e943b07dd3e (diff) | |
download | ayatana-indicator-sound-237041021ddb7d0c08542fbdca41d845b14dea82.tar.gz ayatana-indicator-sound-237041021ddb7d0c08542fbdca41d845b14dea82.tar.bz2 ayatana-indicator-sound-237041021ddb7d0c08542fbdca41d845b14dea82.zip |
fixed the crashes and made the key presss/release work nicely with multiple players
Diffstat (limited to 'src/transport-widget.c')
-rw-r--r-- | src/transport-widget.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/transport-widget.c b/src/transport-widget.c index 8b42bd0..64ac04a 100644 --- a/src/transport-widget.c +++ b/src/transport-widget.c @@ -193,8 +193,9 @@ transport_widget_init (TransportWidget *self) g_signal_connect (GTK_ITEM(self), "deselect", G_CALLBACK (transport_widget_deselect), - NULL); - + NULL); + gtk_widget_realize ( GTK_WIDGET (self) ); + } static void @@ -227,6 +228,13 @@ transport_widget_expose (GtkWidget *button, GdkEventExpose *event) return FALSE; } +gboolean +transport_widget_is_selected ( TransportWidget* widget ) +{ + TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(widget); + return priv->has_focus; +} + static void transport_widget_toggle_play_pause(TransportWidget* button, TransportWidgetState update) @@ -330,10 +338,14 @@ transport_widget_react_to_key_press_event ( TransportWidget* transport, priv->current_command = transport_event; priv->key_event = transport_event; + printf ( "transport widget - react to key press event -> is the window null: %i", + gtk_widget_get_window (GTK_WIDGET (transport) ) == NULL ); cairo_t *cr; + + printf("transport_widget_react_to_key_press_event: before drawing\n"); cr = gdk_cairo_create ( GTK_WIDGET(transport)->window ); draw ( GTK_WIDGET(transport), cr ); - cairo_destroy (cr); + cairo_destroy (cr); } } @@ -352,7 +364,7 @@ transport_widget_react_to_key_release_event ( TransportWidget* transport, &value, 0 ); } - + printf("transport_widget_react_to_key_release_event: before transport_widget_react_to_key_release_event\n"); transport_widget_react_to_button_release ( transport, transport_event ); } @@ -397,14 +409,16 @@ transport_widget_react_to_button_release ( TransportWidget* button, TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(button); if(priv->current_command == TRANSPORT_NADA){ //g_debug("returning from the playbutton release because my previous command was nada"); - + printf("transport_widget_react_to_button_release: inside if(priv->current_command == TRANSPORT_NADA)\n"); /* Update the drawing in any case, should not hurt :) */ // return; } else if(priv->current_command != TRANSPORT_NADA && command != TRANSPORT_NADA){ priv->current_command = command; + printf("transport_widget_react_to_button_release: inside if(priv->current_command != TRANSPORT_NADA && command != TRANSPORT_NADA)\n"); } + printf("transport_widget_react_to_button_release: before drawing\n"); cairo_t *cr; cr = gdk_cairo_create ( GTK_WIDGET(button)->window ); |