Commit 88cb3016 authored by Robert Ancell's avatar Robert Ancell

applications: Add hack detect snaps before X-SnapInstanceName works

parent 1e617a54
Pipeline #67503 passed with stages
in 3 minutes and 40 seconds
......@@ -233,6 +233,16 @@ get_portal_app_id (GAppInfo *info)
snap_name = g_desktop_app_info_get_string (G_DESKTOP_APP_INFO (info), "X-SnapInstanceName");
if (snap_name != NULL)
return snap_name;
// FIXME: Hack until X-SnapInstanceName is ready
// https://github.com/snapcore/snapd/pull/6520
executable = g_desktop_app_info_get_string (G_DESKTOP_APP_INFO (info), "Exec");
if (executable != NULL && strstr (executable, "/snap/") != NULL)
{
const gchar *id = g_app_info_get_id (info);
g_auto(GStrv) tokens = g_strsplit (id, "_", 2);
return g_strdup_printf ("%s%s", PORTAL_SNAP_PREFIX, tokens[0]);
}
}
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment