-
Notifications
You must be signed in to change notification settings - Fork 119
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
Confusing dead key layout, and Wayland problems #704
Comments
Can you explain which setup doesn't work for you? With the key you tried to press and what's the output. Also, fcitx will populate layout to kde keyboard settings, so please don't change any layout in kde keyboard settings (keyboard option is ok). If it doesn't work, it should be fixed, instead of adding "warning". |
All the following examples will use the same test sequence, 'RAlt + ' + [aoeui], RAlt + ` + [aoeui], RAlt + , + c". Here is my working configuration as described in the original post: Broken, and fcitx5 should warn about: "intl. with dead keys" types the extra apostrophe when trying to type the accents: Broken, and fcitx5 should warn about: "intl. with dead keys" with KDE's right alt disabled fixes the apostrophe problem, but I need to type a cedilla for French: Broken, and fcitx5 should warn about: "alt. intl." gives me random accents: Those alternative layout sometime also mess with my normal typing of the quotation mark and apostrope without RAlt held down. This makes it hard for me to code.
That stopped working ever since I switched from X11 to Wayland. No input method, whether fcitx5 or ibus can change KDE's keyboard layout. Freedesktop/KDE still needs to provide an API for that.
It is impossible for me to type Chinese, or Japanese Kana without changing it in KDE. I use Dvorak for English & French, and a modified QWERTY with Windows/Alt/Menu keys remapped to Henkan for Chinese & Japanese & Korean. fcitx5 worked on X11, but has always failed to switch my layout from Dvorak to QWERTY on Wayland. Every time I switch languages, I need to use both CTRL+ESC to switch fcitx5, and click on the KDE keyboard layout icon in the taskbar (there are two "jp" icons that always show the same thing, except only the left one has the bouncing animation on click, oh well). The layouts I configured in fcitx5 have always been ignored on Wayland. The Wayland problem should be discussed in a different issue on GitHub. The problem is probably on Freedesktop/KDE's end and not fcitx5's. While it is inconvenient, I was able to find a workaround quickly compared to this issue about dead keys / intl compose layout problem. |
I think you have some misunderstanding about dead key, so basically, dead key doesn't need a leading compose key. So if your layout is US. intl, ' + a will directly gives you á. The ' key will produce dead_acute, instead of acute, this makes compose works differently. To learn about Compose sequence, check /usr/share/X11/locale/en_US.UTF-8/Compose on your system. For example, there is (<Multi_Key> is what usually referred as "Compose key")
But there is no
Instead, there is
If you want to customize any compose sequence, you may use ~/.XCompose . The next thing, you don't need to configure kde layout. That will confuse fcitx's layout functionality under KDE. Fcitx even allow you to set the layout for certain input method, so you don't need to mess with the kde's layout. Switching group can be used just like switching layout under KDE. Based on what you describe, you can do things like
Two group like this
If your jp-us layout is coming from your own customized xkb config, you can follow this to make fcitx recognize it, manually hack the profile (quit fcitx first, then change Layout=jp-us) may also work. Reading .xml from ~/.config/xkb is only added recently df632d7 , so you may prefer the method in the blog post above. |
My Japanese layout was automatically switching on X11, but Wayland broke it and made it manual-only. The accents for French I never tried on X11.
Can you test this on KDE Wayland yourself? fcitx5 fails to automatically change the keyboard layout, and I always have to do it manually on Wayland: 2023-01-22.23-45-58.mp4
Thank you for this information. If I had seen it earlier, perhaps somewhere in the documentation, I would have saved 1 hour. However, I need the cedilla so I can't use the dead keys layout. |
It definitely works here. Actually after check your diagnose output again, I find your fcitx5 didn’t open a wayland connection. That’s probably the layout setting code in wayland module doesn’t work. I’m not sure if it’s relevant to how your fcitx starts, can you tell me more about that? |
Basically, the debuginfo part, should look like this
In your case, it's all "Input Context without group", which means wayland connection is not there and definitely the code here doesn't run: fcitx5/src/modules/wayland/waylandmodule.cpp Line 190 in 33ef1c1
Which is the code that set layout under wayland KDE. |
This took 10 hours of debugging. Details will be at fcitx/fcitx5#704 It took so many logins and killall5s, reading various scripts' source codes, looking in /proc/pid/environ and /proc/pid/fd, ldd+strings+rg, installing and setting up auditd, systemctl --user show, and general frustration. It turns out fcitx5 can be started from 3 places: im-config, .desktop autostarts, systemd user autostarts, and kwin wayland, and they conflict with each other. In the end I chose to let kwin_wayland handle it, and now fcitx5 is detecting Wayland properly.
I finally fixed my fcitx5 startup. I turns out im-config was messing with things, and I had to disable it and use kwin_wayland to start my fcitx5. I performed the changes in danielzgtg/linuxenv@d594567 . It detects KDE Wayland now and is able to control the keyboard settings. Your Debugging detailsAt first I thought the wayland support wasn't complied into my distro's fcitx5. I did So you asked about how my fcitx5 was started. I didn't really know either. I had a file in I had a
I then restarted fcitx5 with
Interesting. There is a difference. I was thinking it might be a difference between
So, there is no difference in opened file descriptors between the two flags. I then did --- before 2023-01-28 19:04:40.736842014 -0500
+++ after 2023-01-28 19:04:35.576806458 -0500
@@ -1,13 +1,18 @@
ANDROID_SDK_ROOT=/home/home/Android/Sdk/
CCACHE_DIR=/home/home/.ccache
CLUTTER_IM_MODULE=xim
+COLORFGBG=15;0
+COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
-DEBUGINFOD_URLS=https://debuginfod.ubuntu.com
+DEBUGINFOD_URLS=https://debuginfod.ubuntu.com
DEFAULTS_PATH=/usr/share/gconf/plasmawayland.default.path
DESKTOP_SESSION=plasmawayland
+DISPLAY=:0
DOTNET_CLI_TELEMETRY_OPTOUT=1
EGL_PLATFORM=wayland
GCC_COLORS=error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
+GDK_DPI_SCALE=1
+GDK_SCALE=1
GDM_LANG=en
GDMSESSION=plasmawayland
GLFW_IM_MODULE=ibus
@@ -17,23 +22,37 @@
GTK_MODULES=gail:atk-bridge
GTK_USE_PROFILE=1
HOME=/home/home
-IM_CONFIG_PHASE=2
+IM_CONFIG_CHECK_ENV=1
+IM_CONFIG_PHASE=1
+INVOCATION_ID=a1d380514378477b93606667b714910c
+JOURNAL_STREAM=8:117271
+KDE_APPLICATIONS_AS_SCOPE=1
+KDE_FULL_SESSION=true
+KDE_SESSION_UID=1000
+KDE_SESSION_VERSION=5
+KGLOBALACCELD_PLATFORM=org.kde.kwin
+KONSOLE_DBUS_SERVICE=:1.98
+KONSOLE_DBUS_SESSION=/Sessions/1
+KONSOLE_DBUS_WINDOW=/Windows/1
+KONSOLE_VERSION=220802
LANG=en_US.UTF-8
LANGUAGE=en
LC_ADDRESS=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
-LC_MEASUREMENT=en_US.UTF-8
-LC_MONETARY=en_US.UTF-8
+LC_MEASUREMENT=C
+LC_MONETARY=C
LC_NAME=en_US.UTF-8
-LC_NUMERIC=en_US.UTF-8
+LC_NUMERIC=C
LC_PAPER=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
-LC_TIME=en_US.UTF-8
+LC_TIME=C
LESSCLOSE=/usr/bin/lesspipe %s %s
LESSHISTFILE=/dev/null
LESSHISTSIZE=0
LESSOPEN=| /usr/bin/lesspipe %s
LOGNAME=home
+LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
+MANAGERPID=18181
MANDATORY_PATH=/usr/share/gconf/plasmawayland.mandatory.path
MANPAGER=sh -c 'col -bx | bat -l man -p'
MOZ_ENABLE_WAYLAND=1
@@ -42,15 +61,31 @@
NVM_DIR=/home/home/.nvm
PAPERSIZE=letter
PATH=/home/home/bin:/home/home/.cargo/bin:/home/home/kde/src/kdesrc-build:/home/home/.cabal/bin:/home/home/.ghcup/bin:/home/home/.local/bin:/home/home/.nvm/versions/node/v19.5.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/home/.dotnet/tools
+PLASMA_USE_QT_SCALING=1
+PROFILEHOME=
PWD=/home/home
+QSG_RENDER_LOOP=basic
QT_ACCESSIBILITY=1
+QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_IM_MODULE=fcitx
+QT_WAYLAND_FORCE_DPI=96
SAL_USE_VCLPLUGIN=kde
SDL_IM_MODULE=fcitx
SHELL=/bin/bash
-SHLVL=0
+SHELL_SESSION_ID=c2ffdf40a89e4668a18568dc3d4eec46
+SHLVL=1
+SYSTEMD_EXEC_PID=18372
+TERM=xterm-256color
+TEXTDOMAIN=lightdm
USER=home
-XDG_CONFIG_DIRS=/etc/xdg/xdg-plasmawayland:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
+_=/usr/bin/fcitx5
+WAYLAND_DISPLAY=wayland-0
+WINDOWID=1
+XAUTHORITY=/run/user/1000/xauth_OPxJVO
+XCURSOR_SIZE=24
+XCURSOR_THEME=breeze_cursors
+XDG_ACTIVATION_TOKEN=kwin-2
+XDG_CONFIG_DIRS=/home/home/.config/kdedefaults:/etc/xdg/xdg-plasmawayland:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
XDG_CURRENT_DESKTOP=KDE
XDG_DATA_DIRS=/usr/share/plasmawayland:/usr/local/share/:/usr/share/
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/home
@@ -63,4 +98,8 @@
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session2
XDG_SESSION_TYPE=wayland
XDG_VTNR=8
+XKB_DEFAULT_LAYOUT=us
+XKB_DEFAULT_MODEL=pc105
+XKB_DEFAULT_OPTIONS=lv3:ralt_alt
+XKB_DEFAULT_VARIANT=dvorak
XMODIFIERS=@im=fcitx So I've previously had environment variable problems before when using autostart. There are lots of edge cases about which variables systemd/dbus set and when. A KDE last year or sometime may have fixed it, but I continued with the next step. I rewrote my
Then I realized it was strange that the What I found was slightly disturbing. There was the After running In the end, I decided to give kwin_wayland the job of starting fcitx5, as that seems to be the most maintained and supported way. I disabled the xdg, systemd user, and im-config autostarts. Now fcitx5 detects and controls my KDE Wayland successfully. |
Describe the bug
There should be a warning telling users to not select any keyboard layout with "intl" or "dead keys". The dead keys / compose / accents work, and only work, with the normal layout.Some layouts don't work. They either type nothing, random accented letters, or luanma. They are as follows:
The following regular layouts work and the dead keys work in fcitx5:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be a warning when the user tries to select a dead keys or intl. layout.The user should be informed that those don't work.With the warning they won't have to waste 2 hours debugging like me.
Here is my working configuration:
Desktop (please complete the following information):
fcitx5-diagnose, with fcitx5 working like I want it to
The text was updated successfully, but these errors were encountered: