Skip to content

Fix launch for Flatpak apps without .desktop suffix

Janne Pulkkinen requested to merge matoking/discover:fix_flatpak_launch into master

Ensure the .desktop suffix is added to the file name before attempting to find it. While AppStream specification used to enforce the suffix for desktop applications, it's no longer required.

In practice, most applications launched correctly despite this bug since the Flatpak manifest usually contained the same command, which is used as a fallback. However, this was not the case for all applications: some include a command for the console environment in the Flatpak manifest and another for the desktop environment in the desktop entry file.


This merge request can be tested by installing com.github.Matoking.protontricks from Flathub and attempting to launch it inside Discover. Without the fix, launching Protontricks will use the flatpak_installation_launch fallback instead, which causes the application's help output to be printed into stdout without any apparent effect to the end user.

In addition, when using kdesrc-build I had to copy the runservice executable to ~/kde/usr/lib/libexec/kf5/discover/runservice; it wasn't copied there after the build for some reason.

I checked the AppStream specification here, which seems to imply .desktop was required for desktop applications in the past.

Merge request reports