This is an automated email from the git hooks/post-receive script.

bluesabre pushed a 
commit to branch 
master
in repository panel-plugins/xfce4-pulseaudio-plugin.

commit 972cacd7693a4f3e8ef304c999a920b6ece702f7
Author: Sean Davis <smd.seanda...@gmail.com>
Date:   Sun Mar 29 08:01:11 2020 -0400

    Fix showing inactive players
---
 panel-plugin/pulseaudio-mpris.c | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/pulseaudio-mpris.c b/panel-plugin/pulseaudio-mpris.c
index f505454..2e76fd6 100644
--- a/panel-plugin/pulseaudio-mpris.c
+++ b/panel-plugin/pulseaudio-mpris.c
@@ -353,6 +353,43 @@ pulseaudio_mpris_get_player_snapshot (PulseaudioMpris  
*mpris,
 
 
 
+static gboolean
+pulseaudio_mpris_get_player_summary_from_desktop (const gchar  *player_id,
+                                                  gchar       **name,
+                                                  gchar       **icon_name,
+                                                  gchar       **full_path)
+{
+  GKeyFile  *key_file;
+  gchar     *file;
+  gchar     *filename;
+  gchar     *path;
+
+  filename = find_desktop_entry (player_id);
+  if (filename == NULL)
+    {
+      return FALSE;
+    }
+
+  file = g_strconcat("applications/", filename, NULL);
+  g_free (filename);
+
+  key_file = g_key_file_new();
+  if (g_key_file_load_from_data_dirs (key_file, file, &path, G_KEY_FILE_NONE, 
NULL))
+    {
+      *name = g_key_file_get_string (key_file, "Desktop Entry", "Name", NULL);
+      *icon_name = g_key_file_get_string (key_file, "Desktop Entry", "Icon", 
NULL);
+      *full_path = g_strdup (path);
+      g_free (path);
+    }
+
+  g_key_file_free (key_file);
+  g_free (file);
+
+  return TRUE;
+}
+
+
+
 gboolean
 pulseaudio_mpris_get_player_summary (const gchar  *player_id,
                                      gchar       **name,
@@ -363,7 +400,7 @@ pulseaudio_mpris_get_player_summary (const gchar  
*player_id,
   player = PULSEAUDIO_MPRIS_PLAYER (g_hash_table_lookup 
(mpris_instance->players, player_id));
 
   if (player == NULL)
-    return FALSE;
+    return pulseaudio_mpris_get_player_summary_from_desktop (player_id, name, 
icon_name, full_path);
 
   *name = g_strdup (pulseaudio_mpris_player_get_player_title (player));
   *icon_name = g_strdup (pulseaudio_mpris_player_get_icon_name (player));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to