WezTerm has no icon under Wayland when using fractional scaling (fractional-scale-v1)
What Operating System(s) are you seeing this problem on?
Linux Wayland Fedora 40
Which Wayland compositor or X11 Window manager(s) are you using?
KDE Plasma 6.1.2 with KWin 6.1.2
WezTerm version
wezterm 20240721_002142_1654c9d1 (nightly repo from copr)
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
Related discussion: https://github.com/wez/wezterm/discussions/5842
WezTerm has no icon under Wayland on the taskbar, while on Plasma kickoff it has one. And running wezterm start --class org.wezfurlong.wezterm --always-new-process spawns for a moment a WezTerm icon and then it goes to the W icon.
To Reproduce
Open WezTerm in a Wayland session
Configuration
no config
Expected Behavior
The WezTerm icon to show in the taskbar, rather than the Wayland one.
Logs
No response
Anything else?
Hi ludg1e,
This isn't really a bug, it's just an issue with the way Wezterm has been installed. Did you use your distribution's package manager to install? If so, which distro?
If you are installing yourself from source, you'll need to handle this task too. Without going into too much detail, a desktop file, and an icon image, need to be placed in a known directory; on my system that is:
/usr/share/applications/org.wezfurlong.wezterm.desktop /usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
You can find each these files in the source tree (you need to rename the icon):
assets/wezterm.desktop assets/icon/terminal.png
If you don't want to place them in the system-wide directories, there are options in your home directory too. This is all based on the Freedesktop spec, which you can read about here:
https://specifications.freedesktop.org/desktop-entry-spec/latest/index.html#introduction
HTH
Edit: Just noticed you installed from COPR, presumably on Fedora? In that case, the files listed above should indeed already be installed for you. Quite a few users, have said online that one or more of their apps fail to have an icon when using KDE on Fedora.
Here is a video with some tips on how to fix KDE:
https://youtu.be/Sungl8gWU_8?si=nAyc49eGl14RFUeX&t=129
If that works for you, please close this issue, and maybe file one with Fedora instead.
Sorry to tell but WezTerm has an icon but in kickoff (start menu) thanks to the FDO desktop file. However, when launching, it doesn't have one.
I don't think this is a KDE issue nor a Fedora one, because the app itself is renamed somehow (I don't know how) to wezterm-gui, not WezTerm.
Hi ludg1e,
Where are you seeing "wezterm-gui"? (edit: it is a normal part of wezterm, so it will be in /usr/bin, but it shouldn't be listed as such on the taskbar etc)
Is it possible you have an old install of Wezterm that is conflicting with your copr install? Could you maybe try a more recent nightly version?
Since WezTerm has successfully made its icon available to Kickoff, it sure seems like KDE has everything it needs to also use that Icon on the taskbar. So the question is, why isn't KDE just using that icon on the taskbar too?
It would be interesting to see what happens if you launch wezterm from the command line, without any config file:
/usr/bin/wezterm --skip-config
Hello @loops, Still the same
Okay, so I ran Fedora-KDE-Live-x86_64-40-1.14.iso in a VM, and installed that same version of Wezterm, and it worked (see the screenshot).
Still want to help you get it working, but I think it implicates something in your local install of KDE, rather than any bug in WezTerm. It has been many years since i've used KDE, so hopefully someone else can chime in with some suggestions.
One google search did suggest deleting your icon cache directory, and restarting KDE, but I'll leave that up to your better judgement:
$ rm ~/.cache/icon-cache.kcache
@ludg1e did you solve this?
@ludg1e did you solve this?
Hello, no
I tried deleting the icon cache but nothing.
Hi Xpiravit,
Are you having a similar problem? If so, could you let us know the details of your configuration? It might help narrow down what is triggering the problem. For instance, does your taskbar look like ludg1e's? When I did a fresh install, it didn't look the same, and I couldn't reproduce the problem.
Hi Xpiravit,
Are you having a similar problem? If so, could you let us know the details of your configuration? It might help narrow down what is triggering the problem. For instance, does your taskbar look like ludg1e's? When I did a fresh install, it didn't look the same, and I couldn't reproduce the problem.
For context, I edited with Krita the screenshot to hide what was on my taskbar.
I use KDE 6.1 under Fedora 40.
Hi Xpiravit,
Are you having a similar problem? If so, could you let us know the details of your configuration? It might help narrow down what is triggering the problem. For instance, does your taskbar look like ludg1e's? When I did a fresh install, it didn't look the same, and I couldn't reproduce the problem.
I was having the same problem but I managed to solve it by specifing the app's desktop file by adding it as a property using the method in the video below: Screencast_20240909_014756.webm
However I am now having a different problem, when I pin the application to taskbar, once I close the current window the app icon turns into a question mark. If I click it to open a new window everything freezes for a couple of seconds and then once the window opens everything works again. (It is not clear but after I click the question mark I started moving the mouse around to show that everything froze) Screencast_20240909_014625.webm I am not sure if this is the same or if I need to open a new issue
My specs are exactly the same as posted in the initial message of the thread except instead of fedora 40 I am on nobara 40, not sure if that could make any difference though.
@ludg1e
Do you have (fractional) scaling enabled? I think I'm experiencing the same issue but only on screens with 125% scaling.
On my system WezTerm spawns an initial window with the correct window class (org.wezfurlong.wezterm) but then scaling kicks in and the window respawns with window class wezterm-gui (no class?)
This "respawning" is especially noticeable when moving a WezTerm window between screens with different scales - the window literally disappears on the screen border and reappears on the target screen with all(?) window properties lost.
@ludg1e Do you have (fractional) scaling enabled? I think I'm experiencing the same issue but only on screens with 125% scaling. On my system WezTerm spawns an initial window with the correct window class (
org.wezfurlong.wezterm) but then scaling kicks in and the window respawns with window classwezterm-gui(no class?)This "respawning" is especially noticeable when moving a WezTerm window between screens with different scales - the window literally disappears on the screen border and reappears on the target screen with all(?) window properties lost.
Jesus, thank you.
This is the issue. I do work with fractional scaling at 125% because either I'd become blind. Changed to 100% and the app worked fine, no wezterm-gui title, and the icon was the correct one without needing to add a KWin rule nor anything (COPR version).
So, I guess this needs a proper fix for WezTerm? I don't think this is a KWin issue to be honest...
I guess then that this issue affects to all Wayland compositors that implement the fractional-scale-v1 protocol and thus users that use fractional scaling?
https://wayland.app/protocols/fractional-scale-v1
ludg1e,
You're right, it is a problem with Wezterm. Confirmed the same issue exists under Gnome on Fedora 40.
FWIW, there is no part of the wayland protocol that manages icons, those are produced by the compositor from the .desktop file. wezterm always uses its own window class. What I suspect is happening here is that the compositor is synthesizing its own window for fractional scaling, and that isn't picking up the correct information. Technically speaking, I don't think there is anything wezterm can do about that. However, if wezterm were to implement a fractional scaling protocol, I suspect that will avoid those issues.
What I suspect is happening here is that the compositor is synthesizing its own window for fractional scaling, and that isn't picking up the correct information.
When moving wezterm window between scaled and non-scaled displays the window seems to be destroyed and spawned again in the middle, losing it's title in process, but not when moving between two scaled displays, so sounds very plausible
Is there anything I can do to help here?
I had to switch to nightly wezterm after the last gnome update because the previous stable version would could no longer start. The nightly version is relatively stable if you disable config.window_decorations, but it also no longer has a wmclass, so it's not possible to assign a keyboard shortcut to "switch to wezterm". I've been living with it for a couple of months, but it's starting to bother me too much.
Any debugging I can provide? I'm willing to try random test builds, provide logs, anything, if it would help fix either or both of these bugs. I really liked this app! :)
I can confirm the issue on OpenSUSE Tumbleweed with KDE plasma 6
Yes, same problem in KDE 6 on nixos 24.11 with 175% scaling
I noticed this happens even with non-fractional scaling if you have two monitors with different scales. I have a 1080p monitor at 100% and a 4K monitor at 200%. KDE Plasma 6.2.4 on Fedora 41.
Here's a workaround for the missing icon on KDE:
- Open WezTerm. Observe the default Wayland icon.
- Right-click the titlebar
- Click
More Actions>Configure Special Window Settings... - A "Window Rules" dialog for "Window settings for wezterm-gui" should appear.
- Click the trashcan button on the "Window title" row.
- Click
Add Property...and add "Desktop file name". - Change "Apply initially" to "Force"
- Enter this path:
/usr/share/applications/org.wezfurlong.wezterm.desktop. - Click
OK.
I am having same issue on Fedora 41 KDE.
Using the suggestions above doesn't fully resolve the issue. I have following setting :
I have pinned WezTerm on KDE Taskbar. The pinned icons shows correctly. But on clicking it, it still spawns a separate window with 'generic Wayland icon'.
BTW I am using AppImage for WezTerm.