libsysprof-ui: use flatpak-spawn when necessary

This commit is contained in:
Christian Hergert
2019-05-10 09:22:57 -07:00
parent 2161668c01
commit 1d62916295

View File

@ -820,7 +820,22 @@ sysprof_profiler_menu_button_validate_spawn (SysprofProfilerMenuButton *self,
}
else
{
sysprof_profiler_set_spawn_argv (priv->profiler, (const gchar * const *)argv);
g_autoptr(GPtrArray) cooked = g_ptr_array_new ();
if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS))
{
g_ptr_array_add (cooked, "flatpak-spawn");
g_ptr_array_add (cooked, "--host");
g_ptr_array_add (cooked, "--watch-bus");
}
for (guint i = 0; argv[i] != NULL; i++)
g_ptr_array_add (cooked, argv[i]);
g_ptr_array_add (cooked, NULL);
sysprof_profiler_set_spawn_argv (priv->profiler,
(const gchar * const *)cooked->pdata);
g_object_set (entry,
"secondary-icon-name", NULL,
"secondary-icon-tooltip-text", NULL,