summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Benítez León <nbenitezl@gmail.com>2019-03-02 20:37:32 -0400
committerNelson Benítez León <nbenitezl@gmail.com>2019-03-03 18:43:33 -0400
commit1acffad4bfa168555d3899f0763ac1b5e0b47494 (patch)
tree5916fde78f352a399d70d8ae5c8af92f7c2ecc41
parentf90e1f317ebef7a7e6fccc5019f6ffafd1703a3a (diff)
downloadglib-1013-search-evince-or-totem-zero-result-from-flatpaks.tar.gz
try harder to get the exec name for flatpaks1013-search-evince-or-totem-zero-result-from-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
-rw-r--r--gio/gdesktopappinfo.c12
1 files changed, 12 insertions, 0 deletions
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 */