Skip to content

Add full complement of key/value pairs to Desktop Entry file #18101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

RogueScholar
Copy link
Contributor

Description

This PR extends the RetroArch desktop entry file—responsible for integrating the app with
Linux desktop environments—to include all relevant properties present in the most recent version of the specification. Some notable aspects are:

  • TryExec/Exec: TryExec should contain the canonical path to the executable, however I was unable to identity a robust mechanism for populating the correct value at build time, so we fallback to /usr/bin here. To Exec we add the %F token, signifying that RA is a "file handler" so that users are allowed to drag one or more files over the launcher entry which are converted into arguments appended to the invocation command.
  • MimeType: This key determines which file extensions the system should offer to open with RA. It should be periodically reviewed for any new MIME registrations which need to be represented going forward. The value present here represents a fairly exhaustive search of the current IANA-registered types cross-referenced using the official RetroArch documentation's list of supported file extensions for all currently-distributed cores.
  • PrefersNonDefaultGPU: Linux by default offers hardware to processes in order from least capable to most performant. This key reverses that behavior so more demanding emulation cores will run more smoothly.
  • SingleMainWindow: Changes the default behavior when the launcher is clicked while an instance is already running from launching a second instance to bringing forward the main window of the already running instance.

References

Version 1.5 (the most recent) of the Freedesktop.org Desktop Entry Specification was the authoritative reference for these changes.

Related Issues

Closes #17347.

Related Pull Requests

These changes were initially identified during an (unsolicited) audit of the desktop entry file within Pull Request #16449 (review); additional notes can be found there.

Author's Notes

Heartfelt thanks go out to @RobLoach for opening the above-linked issue which indicated that these changes might be received as a welcome enhancement to the project, to which my participation thus far has largely been confined to the stewardship of the Debian package repositories and related CI/CD systems on Launchpad.net.

This commit extends the RetroArch desktop entry
file—responsible for integrating the app with
Linux desktop environments—to include all relevant
properties. Some notable aspects:

- **`TryExec`**/**`Exec`**: TryExec _should_
  contain the canonical path to the executable,
  however the RA buildsystem lacks a ready
  mechanism for populating the correct value for
  the target at build time, so we fallback to
  searching $PATH here. To Exec we add the %F
  token, meaning that RA is a "file handler" that
  users are able to drag files onto the launcher
  icon that become arguments to the launch command.
- **`MimeType`**: This key determines which file
  extensions the system should offer to open with RA.
  It should be regularly reviewed for any new MIME
  registrations which need to be represented going
  forward.
- **`PrefersNonDefaultGPU`**: Linux by default offers
  hardware to processes in order from least capable to
  most performant. This key reverses that behavior so
  more demanding emulation cores will run more
  smoothly.
- **`SingleMainWindow`**: Changes the default behavior
  when the launcher is clicked while an instance is
  already running from launch a second instance to
  elevate the main window of the already running one.

Version 1.5 of the Freedesktop [Desktop Entry
Specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/) was the reference for these changes.

Signed-off-by: Peter J. Mello <[email protected]>
@LibretroAdmin LibretroAdmin merged commit 6019fc8 into libretro:master Jul 18, 2025
31 checks passed
@RogueScholar RogueScholar deleted the desktop-entry-file branch July 19, 2025 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update FreeDesktop Entry Spec
2 participants