flathub / io.github.spacingbat3.webcord

https://flathub.org/apps/details/io.github.spacingbat3.webcord
11 stars 11 forks source link

Icon in window title bar in KDE Plasma/KWin shows a Wayland W logo rather than WebCord logo. #62

Closed ludg1e closed 1 year ago

ludg1e commented 1 year ago

Hello!

Recently I've found out about WebCord and installed it on my system through Flathub. The app works flawlessy, but unfortunately I noticed a minor bug that sometimes happens with apps under Wayland in KDE, is that the icon in the window title bar is the Wayland logo (W) rather than the app icon. image

A workaround that I've tested and works is by adding a KWin app (or window) rule that specifies the desktop file of the flatpak app (io.github.spacingbat3.webcord) rather than "WebCord". image Workaround KWin rule code:

[Application settings for WebCord]
Description=Application settings for WebCord
desktopfile=io.github.spacingbat3.webcord
desktopfilerule=4
wmclass=\sWebCord
wmclasscomplete=true
wmclassmatch=1

While this workaround works, it's a dirty solution to a problem that, due to my OS nature (immutable) I can't test if it happens on other distributions of WebCord (not flatpak). I'm reporting this here since I can't give evidence that this happens on other OSes or packages that aren't flatpak.

So, I'm hoping someone can try reproduce it, and if possible, provide a fix. Though I think this is more an error of the main repo of WebCord rather than the flatpak.

Some logs: https://hatebin.com/fgoafndhmq

OS: image

Some resources that I've found on the way: https://discussion.fedoraproject.org/t/inconsistant-titlebar-icons-for-wayland-apps/36810 https://nicolasfella.de/posts/fixing-wayland-taskbar-icons/ https://bugs.kde.org/show_bug.cgi?id=453776 https://github.com/flathub/com.spotify.Client/issues/68#issuecomment-570954601

Thank you and have a nice day.

axtloss commented 1 year ago

Thanks for the extensive bug report! Considering you have a possible solution, could you open a pull request with the fix applied? The desktop file is located (here)[https://github.com/flathub/io.github.spacingbat3.webcord/blob/master/vitamins/io.github.spacingbat3.webcord.desktop]

Also a sidenote, WebCord offers appimages which tend to work on most distros, so you could test the appimages on immutable distros

ludg1e commented 1 year ago

I think you've misunderstood. I haven't figured out how to fix it yet.

The workaround with KWin works by importing the script into KWin, but it shouldn't be the way of fixing this, as well that the rule can't work on .desktop files.

The current issue is that the window doesn't find under KWin the right flatpak desktop file (I think).

I've tested the appimage and it has the issue fixed, though I don't know why.

By the way, why isn't this method of building, which is based on the tarball, being used? https://github.com/vega-d/WebCord_flatpak_build

ludg1e commented 1 year ago

Maybe @TheEvilSkeleton could shed some light (sorry for pinging you).

axtloss commented 1 year ago

I think you've misunderstood. I haven't figured out how to fix it yet. The workaround with KWin works by importing the script into KWin, but it shouldn't be the way of fixing this, as well that the rule > can't work on .desktop files.

Oh yeah my bad, I didn't read the code snippet correctly and thought it's a .desktop file. I do have the same issue with all flatpak applications that run natively on wayland and use GTK. A possible workaround would be to restrict webcord of wayland permissions so that it launches using Xorg, which should make the icon appear

ludg1e commented 1 year ago

While I can live with the KWin script, this should be somehow addressed, as this issue on most apps has been addressed upstream rather than through the distribution method/service. Which is the current state of building WebCord from the source rather than extracting the appimage?

ludg1e commented 1 year ago

Though looking at pending PRs, it seems that an upcoming custom window bar will be available at some point (probably), so I don't think it's worth it spending more time looking into this.

If someone wants to get a quick fix just use the KWin script, stick with the bug or use XWayland/X11.

Have a nice day.