proton-bridge icon indicating copy to clipboard operation
proton-bridge copied to clipboard

Wayland Default Icon instead of Proton Icon

Open vanlueckn opened this issue 2 years ago • 5 comments

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

vanlueckn avatar Nov 29 '23 12:11 vanlueckn

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.

LBeernaertProton avatar Nov 29 '23 12:11 LBeernaertProton

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.

gudvinr avatar Dec 05 '23 23:12 gudvinr

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

vanlueckn avatar Dec 07 '23 23:12 vanlueckn

https://github.com/ProtonMail/proton-bridge/blob/master/dist/proton-bridge.desktop

It already does

gudvinr avatar Dec 08 '23 00:12 gudvinr

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.

ReillyBrogan avatar Dec 15 '23 19:12 ReillyBrogan