Skip to content
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

[Dist] set the correct WM Class in the flatpak Desktop Entry #4181

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MattSturgeon
Copy link

@MattSturgeon MattSturgeon commented Dec 16, 2024

As discussed on Discord, the WM Class is incorrect in the Desktop Entry.

For whatever reason this has not caused problems in the flatpak itself, likely because flatpak or the DE is able to deduce that there is only one desktop entry and one app in the flatpak?

Screenshot From 2024-12-15 23-43-29

Downstream

However for downstream packages that use this file as a base template, this subtle inconsistency can lead to issues.

See NixOS/nixpkgs#365460 for example.

Downstream, the window is untracked due to the wmclass mismatch:
Screenshot From 2024-12-16 00-00-57

Without that PR:
Screenshot From 2024-12-15 21-37-07

With that PR:
Screenshot From 2024-12-15 21-36-40

Single "main" window

I've also set SingleMainWindow=true. This is a new key added in Desktop Entry Spec v1.5. It acts as a hint to the DE regarding whether this is a single-window app (not counting things like child windows). For instance, it hints at whether a "New Window" button would make sense.

In GNOME we see exactly that:
(screenshot from another project where I was playing with the same thing)
image

Flathub

Mirror PR: flathub/com.heroicgameslauncher.hgl#181

Build 168701 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/151803/com.heroicgameslauncher.hgl.flatpakref

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

This hints to the DE that the application only supports one "main"
window.

In GNOME, this prevents the DE adding a useless "New Window" button.
@flavioislima
Copy link
Member

flavioislima commented Dec 16, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@MattSturgeon

This comment was marked as resolved.

Copy link
Member

@Etaash-mathamsetty Etaash-mathamsetty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MattSturgeon
Copy link
Author

also make a PR here: flathub/com.heroicgameslauncher.hgl

Sure thing, done

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.

3 participants