From 4f9fd57c8a732db2180c0298e56b595bfaa47058 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 23 Jun 2016 15:26:14 +0200 Subject: [PATCH] client-info: Reliable desktop ID for flatpak as well Now that xdg-app has been renamed, we also need to check for the "flatpak-" prefix for the cgroup. https://bugs.freedesktop.org/show_bug.cgi?id=96655 --- src/gclue-client-info.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gclue-client-info.c b/src/gclue-client-info.c index f128736..1a47669 100644 --- a/src/gclue-client-info.c +++ b/src/gclue-client-info.c @@ -207,10 +207,13 @@ get_xdg_id (guint32 pid) continue; scope = g_path_get_basename (unit); - if (!g_str_has_prefix (scope, "xdg-app-") || + if ((!g_str_has_prefix (scope, "xdg-app-") && + !g_str_has_prefix (scope, "flatpak-")) || !g_str_has_suffix (scope, ".scope")) break; + /* strlen("flatpak-") == strlen("xdg-app-") + * so all is good here */ name = scope + strlen("xdg-app-"); dash = strchr (name, '-'); -- 2.7.4