GLib contains a function to search installed desktop files for a given set of search terms. The implementation includes the binary name from the Exec= key in the index. To avoid a search for 'flatpak' (and a number of common interpreters) matching every app on the system, there is special logic to ignore the binary name if is one of these common interpreters.
As a result, a desktop search for "Flatpak" matches this launcher. (I'd attach a screenshot but the file chooser portal has apparently fallen down a well.)
One might argue that GLib should parse the line with g_shell_parse_argv() rather than string-splitting. But Flextop could avoid this issue by only quoting the strings that may need to be quoted (namely the ones parsed out of the original Exec= line) rather than the statically-known ones like flatpak and run.
GLib contains a function to search installed desktop files for a given set of search terms. The implementation includes the binary name from the
Exec=
key in the index. To avoid a search for 'flatpak' (and a number of common interpreters) matching every app on the system, there is special logic to ignore the binary name if is one of these common interpreters.However, the implementation in GLib currently performs a simple split at the first whitespace character then checks for exact string equality. flextop quotes each parameter in the rewritten
Exec=
line, including the leadingflatpak
command:https://github.com/refi64/flextop/blob/b8ca6d9952a9f5d40df99903448c3fa7ccea80ee/src/xdg-desktop-menu.c#L75-L78
Here is the resulting line from a launcher I have just created:
As a result, a desktop search for "Flatpak" matches this launcher. (I'd attach a screenshot but the file chooser portal has apparently fallen down a well.)
One might argue that GLib should parse the line with
g_shell_parse_argv()
rather than string-splitting. But Flextop could avoid this issue by only quoting the strings that may need to be quoted (namely the ones parsed out of the originalExec=
line) rather than the statically-known ones likeflatpak
andrun
.