Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions packages/hyprland/0003-input-method-resend-a-replaced-keymap.patch
Original file line number Diff line number Diff line change
@@ -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<IKeyboard> 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<CInputMethodV2> m_owner;

WP<IKeyboard> m_lastKeyboard;
+ std::string m_lastKeymap;
};

class CInputMethodPopupV2 {
12 changes: 8 additions & 4 deletions packages/hyprland/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand All @@ -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
}

Expand Down
11 changes: 9 additions & 2 deletions packages/hyprland/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Loading