From 1acffad4bfa168555d3899f0763ac1b5e0b47494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= Date: Sat, 2 Mar 2019 20:37:32 -0400 Subject: try harder to get the exec name for flatpaks so gnome-shell's application search does not show zero result for an application that is installed both by distro package and by flatpak. Fixes issue gnome-shell#1013 --- gio/gdesktopappinfo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 7d7425ea9..946f45ebf 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -1099,6 +1099,18 @@ desktop_file_dir_unindexed_setup_search (DesktopFileDir *dir) /* Special handling: only match basename of first field */ gchar *space; gchar *slash; + gchar *tmp; + + /* For 'flatpak run' case, use --command if present. see gnome-shell#1013 */ + if ((tmp = g_strstr_len (raw, -1, "flatpak run")) && + (tmp = g_strstr_len (tmp, -1, "--command="))) + { + tmp = g_strdup (tmp + strlen("--command=")); + g_free (raw); + raw = tmp; + tmp = NULL; + value = raw; + } /* Remove extra arguments, if any */ space = raw + strcspn (raw, " \t\n"); /* IFS */ -- cgit v1.2.1