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

Wayland Default Icon instead of Proton Icon #443

Open
vanlueckn opened this issue Nov 29, 2023 · 5 comments
Open

Wayland Default Icon instead of Proton Icon #443

vanlueckn opened this issue Nov 29, 2023 · 5 comments
Labels
blocked Work on the issue is blocked by something bug Something isn't working

Comments

@vanlueckn
Copy link

Expected Behavior

Proton Mail Bridge should have the same icon as the X11 application when using wayland.

Current Behavior

Proton Mail Bridge has the Wayland Default Icon in the taskbar and as app icon.

Possible Solution

Steps to Reproduce

  1. Start Proton Mail Bridge with Wayland

Version Information

Proton Mail Bridge v3.6.1 on Arch Linux with Wayland

Context (Environment)

Screenshots:

grafik
grafik

@LBeernaertProton LBeernaertProton added bug Something isn't working blocked Work on the issue is blocked by something labels Nov 29, 2023
@LBeernaertProton
Copy link
Collaborator

Thanks for the report, this seems to be a Qt issue.

It could be fixed in a newer version, but we are unable to upgrade at this point.

@gudvinr
Copy link

gudvinr commented Dec 5, 2023

It's technically not a Qt issue but rather wayland issue.

Here's some background:
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/52

It is possible to display icon but you need to setup desktop file in a specific way. Basically, .desktop file must have the same app id (window class on X11) as app itself.

@vanlueckn
Copy link
Author

So would it help if this application would ship with a .desktop file or should every user create a file themselves?

@gudvinr
Copy link

gudvinr commented Dec 8, 2023

@ReillyBrogan
Copy link

This is not a Qt issue. Applications cannot set their own window icon on Wayland, thus setWindowIcon is a no-op.

The actual correct solution here is to use QGuiApplication::setDesktopFileName() with the name of the .desktop without the .desktop suffix. So if the .desktop file is installed as /usr/share/applications/proton-bridge.desktop then the corresponding call would be QGuiApplication::setDesktopFileName("proton-bridge"). This will set the appID on Wayland which will allow the WM to match the open window to the desktop file, it can then retrieve which icon to use from that. It's a no-op when running in X11/Xwayland, so is safe to use without guards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Work on the issue is blocked by something bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants