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

Fix wayland window associations by renaming .desktop file #1570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ReillyBrogan
Copy link

For Wayland window managers to correctly associate open windows with the corresponding .desktop file the name of the .desktop file sans .desktop suffix needs to match the window appId.

By default Qt sets the appId to the name of the binary, but QCoreApplication::setOrganizationDomain("seafile.com"); in src/main.cpp causes it to use the domain to create a fully qualified appId (com.seafile.seafile-applet). This does not match the desktop file seafile.desktop, which causes open windows to not be correctly associated with the launcher. While it's possible to use QGuiApplication::setDesktopFileName() to override the appId it's more consistent with FreeDesktop specs to use the fully qualified appId instead.

To see the difference this makes it is sufficient to start seafile-applet in a Plasma Wayland session (which has easily accessible window property introspection tools) with and without com.seafile.seafile-applet.desktop being the name of the .desktop file. Without the window will show the generic Wayland icon in the overview, with it will show the seafile icon shipped in the package.

Resolves #1568 (probably)

For Wayland window managers to correctly associate open windows with the corresponding .desktop file the name of the `.desktop` file sans `.desktop` suffix needs to match the window appId.

By default Qt sets the appId to the name of the binary, but `QCoreApplication::setOrganizationDomain("seafile.com");` in `src/main.cpp` causes it to use the domain to create a fully qualified appId (`com.seafile.seafile-applet`). This does not match the desktop file `seafile.desktop`, which causes open windows to not be correctly associated with the launcher. While it's possible to use `QGuiApplication::setDesktopFileName()` to override the appId it's more consistent with FreeDesktop specs to use the fully qualified appId instead.

To see the difference this makes it is sufficient to start seafile-applet in a Plasma Wayland session (which has easily accessible window property introspection tools) with and without `com.seafile.seafile-applet.desktop` being the name of the `.desktop` file. Without the window will show the generic Wayland icon in the overview, with it will show the seafile icon shipped in the package.

Resolves haiwen#1568 (probably)
@killing
Copy link
Member

killing commented Oct 31, 2024

Thanks! We'll have a look.

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.

Appimage misses an icon.
2 participants