From 8f220762f73c59999f40cd86d7cb6021703b22c0 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikegami Date: Thu, 12 Nov 2026 22:47:21 +0900 Subject: [PATCH] hyprland 0.57.0-3.4: resend an on-screen keyboard's replaced keymap to the input method The input method's keyboard grab sent a keymap only when the keyboard changed. squeekboard replaces its virtual keyboard's keymap on a layout change, so fcitx5 holding the grab kept the old one, and squeekboard's space reached it as "l". Compare the keymap too. On the 7 Pro with fcitx5 and Mozc: space converts now (before, "l"). Co-Authored-By: Claude Opus 5.5 --- ...nput-method-resend-a-replaced-keymap.patch | 41 +++++++++++++++++++ packages/hyprland/PKGBUILD | 12 ++++-- packages/hyprland/README.md | 11 ++++- 3 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 packages/hyprland/0003-input-method-resend-a-replaced-keymap.patch diff --git a/packages/hyprland/0003-input-method-resend-a-replaced-keymap.patch b/packages/hyprland/0003-input-method-resend-a-replaced-keymap.patch new file mode 100644 index 000000000..5f3a87f75 --- /dev/null +++ b/packages/hyprland/0003-input-method-resend-a-replaced-keymap.patch @@ -0,0 +1,41 @@ +Subject: [PATCH] input-method: resend the keymap when a keyboard replaces it + +Against Hyprland v0.57.0 (src/protocols/InputMethodV2.{cpp,hpp}). + +The keyboard grab sends a keymap only when the keyboard changes. An +on-screen keyboard (squeekboard, through virtual-keyboard-v1) replaces its +keymap while it stays the same keyboard, for example on a layout change, +so an input method holding the grab (fcitx5) kept decoding its keycodes +with the old keymap: squeekboard's space reached fcitx5 as "l". Letters +happened to keep their codes. + +Compare the keymap too, and resend it when it changed. + +--- i/src/protocols/InputMethodV2.cpp ++++ w/src/protocols/InputMethodV2.cpp +@@ -29,10 +29,14 @@ + + void CInputMethodKeyboardGrabV2::sendKeyboardData(SP keyboard) { + +- if (keyboard == m_lastKeyboard) ++ // A virtual keyboard (an on-screen keyboard) replaces its keymap while it ++ // stays the same keyboard, so compare the keymap too, or the input method ++ // keeps decoding its keycodes with the old one. ++ if (keyboard == m_lastKeyboard && keyboard->m_xkbKeymapV1String == m_lastKeymap) + return; + + m_lastKeyboard = keyboard; ++ m_lastKeymap = keyboard->m_xkbKeymapV1String; + + auto keymapFD = allocateSHMFile(keyboard->m_xkbKeymapV1String.length() + 1); + if UNLIKELY (!keymapFD.isValid()) { +--- i/src/protocols/InputMethodV2.hpp ++++ w/src/protocols/InputMethodV2.hpp +@@ -98,6 +98,7 @@ + WP m_owner; + + WP m_lastKeyboard; ++ std::string m_lastKeymap; + }; + + class CInputMethodPopupV2 { diff --git a/packages/hyprland/PKGBUILD b/packages/hyprland/PKGBUILD index 7a08299e2..1ae92db81 100644 --- a/packages/hyprland/PKGBUILD +++ b/packages/hyprland/PKGBUILD @@ -36,8 +36,8 @@ pkgname=(hyprland hyprpm) pkgver=0.57.0 -pkgrel=3.3 -pkgdesc='a highly customizable dynamic tiling Wayland compositor (Omarchy Mobile: DPMS retry, rotation hold)' +pkgrel=3.4 +pkgdesc='a highly customizable dynamic tiling Wayland compositor (Omarchy Mobile: DPMS retry, rotation hold, input-method keymap)' arch=(aarch64) url="https://github.com/hyprwm/Hyprland" license=(BSD-3-Clause) @@ -104,13 +104,15 @@ source=("$_archive.tar.gz::$url/releases/download/v$pkgver/source-v$pkgver.tar.g wl-output-global-grace.patch monitor-rule-vrr.patch 0001-dpms-keep-retrying-a-refused-dpms-commit.patch - 0002-render-hold-the-last-frame-across-a-rotation.patch) + 0002-render-hold-the-last-frame-across-a-rotation.patch + 0003-input-method-resend-a-replaced-keymap.patch) sha256sums=('82d006ba9264fe67266c7d583c16f1a6c64d51424dbdc472c3e9c9d5ddfcd559' '26d62139b8ae55e286bcdff1838a6bc01a021d8f1039b40b8fa523df83f61610' '8fa0f57dc1b3246ab4e30ae81419150f4af7767fb31e739e36c824c6d99fab73' 'c14fb0ec02d97100bcfa4e5c8daaf524972fa5c665e04960619744ba01c73c39' 'a5670d9a6cdee3f3990a81cdecfd5e1f95771ebd1d7b1e2622ac7187684b8836' - 'c69e64fe55a25a7baa2751ff795ae1f8a1ddfc1d162b9b35f9d821675be02bb7') + 'c69e64fe55a25a7baa2751ff795ae1f8a1ddfc1d162b9b35f9d821675be02bb7' + 'dd65d96b9d9f9777b9c460642a74f0ac6cbcf875a9a454299f3bf12a9666e03d') prepare() { ln -sf hyprland-source "$_archive" @@ -125,6 +127,8 @@ prepare() { patch -Np1 --fuzz=0 -i "$srcdir/0001-dpms-keep-retrying-a-refused-dpms-commit.patch" # Omarchy Mobile: hold the last frame across a rotation until the layers have drawn, then turn it in as Android does patch -Np1 --fuzz=0 -i "$srcdir/0002-render-hold-the-last-frame-across-a-rotation.patch" + # Omarchy Mobile: resend an on-screen keyboard's replaced keymap to the input method (fcitx5) + patch -Np1 --fuzz=0 -i "$srcdir/0003-input-method-resend-a-replaced-keymap.patch" sed -i -e '/find_package.glaze/s/7...<8 //' {.,hyprpm,start}/CMakeLists.txt } diff --git a/packages/hyprland/README.md b/packages/hyprland/README.md index deb85aed9..e3c1059f3 100644 --- a/packages/hyprland/README.md +++ b/packages/hyprland/README.md @@ -14,6 +14,7 @@ reported the screen off, but the CRTC never turned off. See | `nvidia-egl-teardown.patch`, `wl-output-global-grace.patch`, `monitor-rule-vrr.patch` | Omarchy's patches from the same commit, unchanged (what they fix: their comments in `prepare()`) | | `0001-dpms-keep-retrying-a-refused-dpms-commit.patch` | The Omarchy Mobile change to `src/output/Monitor.cpp` | | `0002-render-hold-the-last-frame-across-a-rotation.patch` | The Omarchy Mobile change to `src/render/Renderer.cpp` and `src/render/OpenGL.cpp` (the rotation hold, below) | +| `0003-input-method-resend-a-replaced-keymap.patch` | The Omarchy Mobile change to `src/protocols/InputMethodV2.{cpp,hpp}` (the input method's keymap, below) | ## What differs from Omarchy's `hyprland` 0.57.0-2 @@ -32,11 +33,17 @@ reported the screen off, but the CRTC never turned off. See Hyprland's environment (read once at startup): `omamobile-device-panther` sets it in `environment.d`, and the other phones rotate as before until it has run on them. -- `pkgrel=3.3`: the higher of Omarchy's (0.57.0-2) and Arch Linux ARM's +- The input method's keymap (0003). The keyboard grab resends the keymap + when a keyboard replaces it, not only when the keyboard changes. + squeekboard replaces its virtual keyboard's keymap on a layout change, so + fcitx5 holding the grab decoded its space as "l" (Japanese input, + `omamobile-ime`). +- `pkgrel=3.4`: the higher of Omarchy's (0.57.0-2) and Arch Linux ARM's (`extra/hyprland` 0.57.0-3, a rebuild for aquamarine 0.16.0 and hyprgraphics 0.6.0) release, plus `.1`, so it sorts above both; `.2` for the rotation hold, since 3.1 is published; `.3` for the half turn's - 383 ms and the alpha-out curve, since 3.2 is published. + 383 ms and the alpha-out curve, since 3.2 is published; `.4` for the + input method's keymap. - `arch=(aarch64)` only. - `build()` runs the two cmake steps of `make release` itself: - with Arch's `-DCMAKE_SKIP_RPATH=ON` (Arch's PKGBUILD seds it into the