Closed musjj closed 1 year ago
What's your distro? I wonder whether they package mozc icon correctly.
Can you list all the files for fcitx5-mozc package?
Also what's the version of fcitx5 and fcitx5-mozc?
I'm using NixOS.
I'd expect the icon to be the same whether a field is focused or not. Is there at least a way to know what icon is it trying to load?
can you try again with latest mozc? 2.26.4220 is pretty old, almost 3 years old.
latest mozc should show different mode icon for hirigana/katakana/direct input/ etc.
I can't provide any support for a out-of-date version.
Here's what it looks like on latest version.
https://github.com/fcitx/fcitx5/assets/259684/2b903762-96cb-4da4-ac8c-123cbcb65cd2
Yeah, it looks like that the package on NixOS is outdated, I'll try to make a package out of the latest version and see if it works.
Tested the latest version, and it works now. Thanks for the help.
Looks like the icon disappearing issue returned in a different form.
On the first startup, fcitx will display a blank icon until you focus on any input field or type on an already focused one.
You can reproduce this by restarting the fcitx5 daemon.
My default input method is Keyboard - English (US)
, so I don't think this is a Mozc
issue anymore.
@musjj the default icon is input keyboard
What is the name/path of that icon? I can't find it in src/data/images
:
https://github.com/fcitx/mozc/tree/fcitx/src/data/images/unix
Does it come from somewhere else?
input-keyboard
is a standard XDG icon name, which should be provided by your DE's default icon theme. Breeze Icons (KDE) and Adwaita (GNOME) both include it.
https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
I see.
I'm guessing that this is a NixOS-specific issue, so closing this for now.
Actually, can you please explain the mechanism fcitx5 uses to retrieve the icons? My problem is that the icon is not affected by my icon themes at all (other tray icons works fine).
I found a few relevant issues across the net:
https://forums.linuxmint.com/viewtopic.php?t=328191 https://forums.linuxmint.com/viewtopic.php?f=47&t=328047
https://fr2.rpmfind.net/linux/RPM/opensuse/15.4/s390x/fcitx-table-4.2.9.8-bp154.1.200.s390x.html
fcitx switched to DBus mechanism to select systray icon which made it impossible to customize systray icon in fcitx's themes. When the KDE default keyboard icon was used, it was ugly-looking and invisible on small screens.
It depends on what does the engine provide for the icon (eg. an absolute path or an icon name), and what do you use for system tray.
For the keyboard addon, it just provides input-keyboard
for icon name.
If you are using Freedesktop StatusNotifierItem compatible system tray, such as KDE's default systray plasmoid or https://github.com/ubuntu/gnome-shell-extension-appindicator , it's the tray's responsibility to locate and render the icon. Fcitx5 just provide the icon name (or absolute path) to the tray via DBus; or current input method label (usually 1~2 characters) rendered as bitmap if "Prefer Text Icon" was enabled in "Classic User Interface" addon.
If you are using old XEmbed based tray implementation (I suspect you are because of https://github.com/awesomeWM/awesome/issues/2995 ), things get a little complicated ... Fcitx5 also implemented something similar to XDG Icon Lookup in classicui
addon.
It read current icon theme name Net/IconThemeName
from xsettings (you can confirm that with dump_xsettings
command)
and tries to locate the icon file based on current theme and XDG standard data dirs ($HOME/.icons
, $XDG_DATA_DIRS/icons
and $XDG_DATA_HOME/icons
)
and finally render the icon with cairo
Thanks for the detailed explanation!
Net/IconThemeName
I think this is the culprit. I don't have xsettingsd
set up on my machine yet. Is there a reason why this method was chosen? Other tray apps seems to rely on the system's GTK settings instead, so they don't have this problem.
But I'll try to configure it and see if helps.
@musjj I don’t think so, fcitx also parse gtk2 and gtk3 icon theme.
@musjj Is your tray xembed, or sni(dbus)?
if xembed, maybe try strace -f fcitx5 2>&1 | grep /icons/
and see what icon fcitx5 is loading.
The linux mint post seems to fcitx4 which is irrelevant.
That's interesting, it seems that when fcitx5 is run as a (user-level) systemd service, icons becomes missing. I'm not sure why it's happening though. This is what the service looks like:
[Install]
WantedBy=graphical-session.target
[Service]
ExecStart=/nix/store/bqzmvngb8zmk43w0vapj3nsbni9676wj-fcitx5-with-addons-5.0.23/bin/fcitx5
[Unit]
Description=Fcitx5 input method editor
PartOf=graphical-session.target
Any hints on what could be the cause?
It looks like that it should be able to read the icons. I ran your strace
command as a user-level service and this is what was in the logs:
I opened the icon paths inside an image viewer and they look correct, but they don't end up being rendered on the tray. This issue does not happen when I run fcitx5
outside of a service.
when you say "This issue does not happen when I run fcitx5 outside of a service.", what does this mean?
Does it mean the icon works if it's not run as a systemd service?
since your icon is a svg file, do you know if your system installation works with svg file? The capability of loading svg file is through gdk-pixbuf2, but provided as a plugin by librsvg.
Thank you! That's basicaly it, the $GDK_PIXBUF_MODULE_FILE
is not inherited when fcitx5
is run as a service.
Thanks for all the help!
Describe the bug The system tray for Mozc disappears when the input field is unfocused.
When focused:
When unfocused:
The default input method (
Keyboard - English (US)
) doesn't suffer from this problem.To Reproduce
Mozc
input methodExpected behavior The icon should stay visible even when unfocused
Desktop (please complete the following information):
Additional context I'm using papirus-icon-theme.