Repository navigation
Look at the modifiers before every batch typed on X11 - #101
Merged
Merged
Conversation
A send on X11 waited for the modifier keys held at its start and then looked only at Escape, the caller's flag and the window in front. A modifier pressed while the value was going in changed it while the send said every key was typed: under Ctrl the rest became shortcuts, under Shift and Caps Lock capitals, after a layout switch another script. A modifier left locked was not seen at all, and a GTK field got nothing of a value under a locked Alt. Before the first key and before every batch the server is now asked for the modifier keys down and for its state. Alt and Caps Lock stop the send and say so, Ctrl and Super are waited for up to two seconds, and Shift, AltGr and a switched layout group count only for a batch typed with keys of the layout, because a spare key carries its keysym on both levels and in every group. Before the first batch a modifier is refused by name, as a held key is. The core state does not tell a latch from a lock, so a latched Ctrl is refused as well. A new stop reason says that the keyboard layout changed, in every layer. What the send looks at before a key moves from linux/send.rs to linux/watch.rs, and the clauses of the stop reasons from i18n.rs to i18n/stop.rs, so that neither file grows past its ceiling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Slint 1.18.1 brings pulldown-cmark, and 0.13.4 has an advisory published today (exponential event growth with ENABLE_WIKILINKS). The required advisories check fails on it for every pull request. 0.13.5 fixes it, was released on 2026-10-21, so it has had the week the dependency rules wait, and keeps the MIT licence. No other crate in the lock moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changes
On X11 a send now asks the server, before its first key and before every batch, which modifier keys are down and what state the keyboard is in (latched and locked modifiers, the layout group). What it finds decides the batch:
Alt was pressed)Caps Lock was pressed)the keyboard layout changed, new), only for a batch with keys of the layoutBefore the first batch a modifier is refused by name (
... is still held), as a held key always was, and Caps Lock gets its own sentence. A spare key carries its keysym on both levels and in every group, so Shift, AltGr and a group switch do not stop a batch made only of spare keys, and a locked Shift or AltGr at the start still types through spare keys as before.Why
Measured on Ubuntu 26.04 with Xvfb and with a real Xorg fed by a uinput keyboard, Slint, GTK4 and Qt victims, the binary from
main:nkb sendsaid it was sent,all with exit code 0. A latched Ctrl (sticky keys, from the physical keyboard or from XTEST) did not reach the keys this program sends, but the core state cannot tell a latch from a lock, so a latch is refused too. Telling them apart needs the XKB extension of x11rb, left out on purpose.
Code
in_the_way,modifiers_downandstopped_before_batchinlinux_rules.rs, pure and tested on every system.linux/watch.rs(new) holds what a send looks at before a key, moved out oflinux/send.rs, which would have joined the band of files near the length ceiling.StopReason::LayoutChangedin every layer, the clauses of the stop reasons moved fromi18n.rstoi18n/stop.rs(the file stood at the ceiling of a whole file), and the marker of a key named in two words keeps one word (caps-lock-pressed).M1597-M1606, andM1537,M1545,M1594moved toi18n/stop.rs.Checked
-D warningson Windows, in WSL (Linux) and foraarch64-apple-darwin. Tests of the touched modules, the shape gate on Linux, the file axis, the repository-wide guards, the contract bridge and the release script tests.main. The existing scenes for Caps Lock, a held modifier, locked Shift and Mod5, Num Lock, the second layout group, Escape, keys in flight and an empty value pass. Two packs type the same as onmain. The X11 clearing loop passes all seven scenes.Also in this pull request
Cargo.locktakespulldown-cmark0.13.5 (from Slint 1.18.1) for RUSTSEC-2026-0414, published today, which made the requiredadvisoriescheck fail on every pull request. 0.13.5 was released on 2026-10-21 and keeps the MIT licence, and no other crate in the lock moves.🤖 Generated with Claude Code