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

App icon is incorrect under KDE Plasma Wayland session #4505

Closed
karnhack opened this issue Jan 16, 2023 · 11 comments · Fixed by #4862
Closed

App icon is incorrect under KDE Plasma Wayland session #4505

karnhack opened this issue Jan 16, 2023 · 11 comments · Fixed by #4862

Comments

@karnhack
Copy link

karnhack commented Jan 16, 2023

Hi
I have OpenSCAD Version: 2021.01 on Arch Linux running KDE Plasma Wayland session.
Window decoration, panel, show the Wayland generic icon instead OpenScad icon.

Screenshot_20230116_201558

Screenshot_20230116_201918

@thehans
Copy link
Member

thehans commented Jan 16, 2023

Your "correct icon" image is nothing like the default openscad icon, so I don't think we would have any control over that.
This looks like more of an issue for the Arch package maintainers.

@t-paul
Copy link
Member

t-paul commented Jan 16, 2023

I'm seeing the issue on Debian too. Running the same app via X11 on Wayland shows the custom icon. Running plain Wayland it's just going to the default. This seems to be related to how the application name is defined.

@karnhack
Copy link
Author

Your "correct icon" image is nothing like the default openscad icon, so I don't think we would have any control over that.
This looks like more of an issue for the Arch package maintainers.

The icon is "correct" in relation to my icon theme (sweet). The problem also remains with the classic icons

Screenshot_20230116_204412

@thehans
Copy link
Member

thehans commented Jan 16, 2023

The code which should set the window icon is here, where it grabs the icon from our .qrc file:
https://github.com/openscad/openscad/blob/master/src/openscad.cc#L724

I have no idea how that interacts with custom icon sets etc, or if Wayland requires some additional/different setting.

@JoKalliauer
Copy link

I have the same problem with evince on Fedora with KDE Plasma using Wayland, It might be a gtk-issue see https://gitlab.gnome.org/GNOME/gtk/-/issues/2034 and picoe/Eto#2255 and https://bugs.kde.org/show_bug.cgi?id=409967

I do not have this issue with Gnome nor with X11 only the combination of KDE Plasma and Wayland seems to cause this problem.

@JKearnsl
Copy link

JKearnsl commented Aug 18, 2023

I have the same problem. I am using PyQT6 and python311.

When I boot from KDE 5.27.7 (FW: 5.108.0 | QT: 5.15.10 | Core: 6.4.10-zen2-1-zen (64-bit)) using Wayland, my app icon disappears:

image

When I boot from X11 everything works fine:

Screenshot_20230818_122326

I think that this could be related to a similar issue I have when using the Sway compositor.
In Wayland, each application (or window?) has an attribute app_id that can used by the compositor to customize its appearance. In Sway, I see that all Openshot windows have their app_id set to "python3" which makes sense since the default behavior is use the client executable filename.
I found a similar bug report for LibreOffice https://bugs.documentfoundation.org/show_bug.cgi?id=125934 and, according to them, the solution for Qt5 application is to declare the name of the desktop file using QGuiApplication::setDesktopFileName().

More info: OpenShot/openshot-qt#1112 (comment)
Community KDE: https://community.kde.org/Guidelines_and_HOWTOs/Wayland_Porting_Notes#Application_Icon

@parkerlreed
Copy link

So KDE devs basically saying it's a per application problem and aren't offering a fix? And they wonder why Wayland adoption is so poor.

@JKearnsl
Copy link

JKearnsl commented Sep 8, 2023

So KDE devs basically saying it's a per application problem and aren't offering a fix? And they wonder why Wayland adoption is so poor.

@parkerlreed, No. As they say in Community KDE:

On Wayland setWindowIcon() no longer works. This also means that currently is not possible to set a per-window icon (because the xdg-shell standard doesn't allow it). It is still possible to set the main application icon that will be shown in task managers and window decorations:
The name of the application icon will be fetched from the .desktop file of the application.
The name of the .desktop file must adhere to the reverse domain standard (e.g. org.kde.app.desktop).
Most of the KDE applications are already working fine because KAboutData takes care of all the necessary steps. If for some reason your application is not using KAboutData, you need to manually call QGuiApplication::setDesktopFileName().

@parkerlreed
Copy link

Yes so they are basically saying we are not going to support the old way of setting the icon all developers have to name their desktop file exactly like this and specify the icon for it to work.

Applications that are working on Wayland right now are just because of QT and not because of the developers specifically tailoring for Wayland. It's unreasonable to expect everybody to follow the KDE guidelines just to get a window icon working.

@t-paul
Copy link
Member

t-paul commented Sep 9, 2023

There's not much point discussing general KDE topics here. Also it's not a KDE-only issue, I do see the problem with Gnome-Shell + Wayland too and not just for OpenSCAD, but for example Quassel also lost it's icon (and that's org.kde.Quassel!).

The problem I see is that it's really hard to find a definitive answer on what the correct way of naming in all the needed places is and what depends on what.

I don't have a huge issue with changing the naming in the AppData but I would have an issue if that's incompatible with X11 based systems.

So if anyone can find some clear documentation on what pieces need to play together (which files in what directories and what specific properties need to match the names defined in the Qt code used by OpenSCAD), please post pointers here. I failed so far to really get a full picture.

For general KDE/Qt discussion, please find some place the respective developers have a chance of seeing it.

@cjmayo
Copy link
Contributor

cjmayo commented Nov 28, 2023

The best way of investigating I have seen is:
https://blogs.gnome.org/mclasen/2016/11/15/help-my-app-icon-is-missing/

Following this I find GNOME has identified the OpenSCAD window as org.openscad.openscad and doesn't have an app name. It's the Qt Wayland code that is creating this window name:

https://code.qt.io/cgit/qt/qtwayland.git/tree/src/client/qwaylandwindow.cpp?h=5.15&id=b8f1882df7215b6e00f66b7a6a08afafe230de29#n159

because QGuiApplication::desktopFileName().isEmpty(). I think the easiest solution is just to QGuiApplication::setDesktopFileName("openscad") #4862.

It is possible to rename the desktop file org.openscad.openscad.desktop - that on its own allows the GNOME Wayland heuristics to guess right, but that seems a bit brittle. And behaviour on X11 would have to be checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants