diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/metadata-widget.c | 5 | ||||
-rw-r--r-- | src/music-player-bridge.vala | 5 | ||||
-rw-r--r-- | src/pulseaudio-mgr.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/metadata-widget.c b/src/metadata-widget.c index 8ab7d1d..96d55ab 100644 --- a/src/metadata-widget.c +++ b/src/metadata-widget.c @@ -331,7 +331,7 @@ metadata_widget_icon_triangle_draw_cb_gtk_3 (GtkWidget *widget, x = allocation.x; y = 0; - gint offset = (allocation.height - gdk_pixbuf_get_height (priv->icon_buf)) / 2; + gint offset = gdk_pixbuf_get_height (priv->icon_buf) / 3; // Draw player icon if (priv->icon_buf != NULL){ @@ -345,7 +345,8 @@ metadata_widget_icon_triangle_draw_cb_gtk_3 (GtkWidget *widget, // Draw triangle but only if the player is running. if (dbusmenu_menuitem_property_get_bool (priv->twin_item, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING)){ - y += allocation.height/2.0 - (double)arrow_height/2.0; + y += gdk_pixbuf_get_height (priv->icon_buf) / 3 + 3; + //allocation.height/2.0 - (double)arrow_height/2.0; cairo_set_line_width (cr, 1.0); //g_debug ("triangle drawing"); diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index 0c9cb10..e7bc1fb 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -229,14 +229,13 @@ public class MusicPlayerBridge : GLib.Object { var result = desktop_or_interface; var tokens = desktop_or_interface.split( "." ); - if ( tokens.length > 1 ){ + if (tokens != null && tokens.length > 1){ result = tokens[tokens.length - 1]; } var temp = result.split("-"); - if (temp.length > 1){ + if (temp != null && temp.length > 1){ result = temp[0]; } - debug("determine key result = %s", result); return result; } diff --git a/src/pulseaudio-mgr.c b/src/pulseaudio-mgr.c index 1da8ce1..ad6d34f 100644 --- a/src/pulseaudio-mgr.c +++ b/src/pulseaudio-mgr.c @@ -175,7 +175,7 @@ void pm_update_volume (gint sink_index, pa_cvolume new_volume) { // LP: #850662 - if (sink_index < 0){ + if (sink_index < 0 || pulse_context == NULL){ return; } pa_operation_unref (pa_context_set_sink_volume_by_index (pulse_context, @@ -197,7 +197,7 @@ void pm_update_mic_gain (gint source_index, pa_cvolume new_gain) { // LP: #850662 - if (source_index < 0){ + if (source_index < 0 || pulse_context == NULL){ return; } pa_operation_unref (pa_context_set_source_volume_by_index (pulse_context, |