Repository navigation
Conversation
The CJK fallback asked FcFontList, which answers in cache order. On Ubuntu the Arphic UKai/UMing faces come first there, so every Han cell in the terminal and in the chrome was drawn in a brush-written kai while the Latin text was fine (ls-fonts --text 中文 reported AR PL UKai TW). Ask for the same single-codepoint charset with the generic monospace family and the user's language applied, then take the first font FcFontSort puts first: on zh_CN that is Noto Sans Mono CJK SC, on an unset locale CJK JP. The unsorted list stays as the fallback for a fontconfig whose sort comes back empty.
Mirr0ch1
force-pushed
the
fix/wayland-font-wheel-ime
branch
from
November 16, 2026 17:48
aa95b46 to
8474c02
Compare
…a notch A wheel notch arrives as 10 units of wl_pointer.axis (Mutter multiplies the discrete step by 10 in meta-wayland-pointer.c; the same notch is 120 in axis_value120), and a touchpad sends a fraction of one. The client passed that value on as a pixel delta to the smooth path and truncated it into a line count for the stepped one, so a notch moved roughly half a row in smooth mode and ten rows in stepped mode, and the settings and sidebars crawled: the chrome read the same value as pixels, ten a notch instead of its thirty-four. Convert to notches once: the integer part goes to VertWheel/HorzWheel, the fraction to precise_wheel_lines, the channel the Windows precision touchpad already uses. A notched wheel then moves three rows a click -- what GNU/Linux terminals and Windows Terminal do, and what keeps the pane in step with the chrome's own three-row notch. A device that reports pixel deltas is taken as it comes: it is already at the distance the finger travelled.
Text input was enabled from wl_keyboard::Enter and disabled from the matching Leave, and nothing else. The mapping Enter consults (keyboard -> seat -> text input) can be incomplete when a surface is focused, and the keyboard and text-input focus events are not atomic, so an enable could be skipped or cancelled. The window then sat in the input method's inactive (English) layout until focus left and came back: with fcitx5 on GNOME, ctrl+space reached the terminal instead of the input method and Chinese could not be typed at all. Track what was last asked of the compositor and act on every path (wl_keyboard Enter/Leave and zwp_text_input_v3 Enter/Leave). A key press proves the surface has focus, so re-ask there as well: the next keystroke, including the rest of a ctrl+space chord, reaches the input method again.
Mirr0ch1
force-pushed
the
fix/wayland-font-wheel-ime
branch
from
November 16, 2026 17:52
8474c02 to
55c2660
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three wayland-input fixes, tested on Ubuntu 26.04 / GNOME 50 (Wayland, fcitx5 + rime, NVIDIA + llvmpipe both).
1. CJK fallback picked Arphic UKai/UMing
thinkterm ls-fonts --text 中文reportedAR PL UKai TWfor every Han character (Latin text was JetBrains Mono, so it looked like a "Chinese font" problem rather than a font-fallback problem).locate_fallback_for_codepointsaskedFcFontList, which answers in fontconfig's cache order; on Ubuntu the Arphic faces sit ahead of Noto CJK there. Ask for the same single-codepoint charset with the genericmonospacefamily and the user's language applied, then take whatFcFontSortranks first.zh_CN.UTF-8C.UTF-8The unsorted list is kept as the last resort for a fontconfig whose sort comes back empty. Symbols and emoji still resolve (
⏵→ Noto Sans Symbols2,🚀→ Noto Color Emoji).2. A wheel notch moved half a row, or ten
wl_pointer.axiscarries 10 units per notch (Mutter'smeta-wayland-pointer.cmultiplies the discrete step byfactor = 10.0; the same notch is 120 inaxis_value120), and a touchpad sends a fraction of one. The Wayland backend passed that value on twice: asprecise_scroll_delta(which the smooth path and the chrome read as pixels: a notch moved ~10px) and truncated asVertWheel(which the stepped path reads as lines: a notch jumped 10 rows). That is why "Smooth" felt like it ate the wheel and "Stepped" suddenly felt fast.The axis is converted to notches once: the integer part feeds
VertWheel/HorzWheel, the fraction feedsprecise_wheel_lines— the channel the Windows precision touchpad already uses — andprecise_scroll_deltais no longer set here, so the chrome'sWHEEL_NOTCH_PIXELSpath applies.A notched wheel then moves three rows a click, as GNU/Linux terminals and Windows Terminal do, which also keeps a pane in step with the chrome's own three-row notch. A device that reports pixel deltas (a trackpad) is taken as it comes.
3. Text input could stay disabled, leaving the IME in English
With fcitx5 on GNOME the input method is reached through Mutter's
zwp_text_input_v3(architecturally: Mutter → IBus → fcitx5's ibusfrontend; GNOME has nozwp_input_method_v2). The client enabled text input fromwl_keyboard::Enteronly, and that path silently does nothing when its keyboard → seat → text-input mapping is not in place yet; the two focus signals are also not atomic, so an enable could be skipped or cancelled. The window then stayed in the input method's inactive layout until focus left and came back —ctrl+spacereached the terminal instead of the IME.Track what was last asked of the compositor (
enabledper text-input object) and act on every path:wl_keyboardEnter/Leave andzwp_text_input_v3Enter/Leave. A key press proves the surface has focus, so re-ask there too; the next keystroke — including the rest of actrl+spacechord — reaches the input method again.Reproduced and verified with compositor-level key injection (
org.gnome.Mutter.RemoteDesktop:CreateSession()→Session.Start()→NotifyKeyboardKeycode(29/57, …)) while watchingfcitx5-remote -n: before the fix the state stayedkeyboard-us, after it flips torime. A plain letter injected the same way lands in the terminal either way, which separates "keys do not reach the app" from "the app is not attached to the IME".Testing
cargo test -p window --features wayland a_wheel_notch_is_ten_axis_units_and_one_notchls-fontsbefore/after (table above), wheel feel in the terminal and in Settings, IME toggle via the injection above.