Set _NET_WM_ICON so that Dock shows correct icon
Currently, the dock only shows the correct icon if an AppImage is either launched through a desktop file and/or the application explicitly sets a window icon (e.g., using Qt) like this:
QFileInfo fi(app.applicationDirPath() + "/../share/pixmaps/qtquickapp.png");
QGuiApplication::setWindowIcon(QIcon(fi.absoluteFilePath()));
which seems to set the _NET_WM_ICON according to https://git.qt.io/consulting-usa/qtbase-xcb-rendering/commit/6131b909532f7bfdcbc8fa2f35f2c6f84c06547d.
Could we make the AppImage AppRun.c read the icon from the desktop file, and have it set the application's _NET_WM_ICON programmatically?
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=465109 may contain some source code that might do it.
We could also hack around it by creating a temporary desktop file, and calling it with xdg-open.
Yes, I wonder which is cleaner and produces less overhead...
We could also hack around it by creating a temporary desktop file, and calling it with xdg-open.
If desktop files were smart enough to have the equivalent of $ORIGIN then we might just xdg-open the desktop file contained inside an app bundle (such as an AppDir or AppImage).
But the XDG Desktop Spec doesn't have this (yet?). Should we propose it?
I mean, you can try... I don't think they would be completely objected to this.
I submitted a patch to KDE, do AppImage maintainers think it makes sense?
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2558