Skip to content

merge up to upstream commit 8e7b574 - #53

Merged
AmmoniumX merged 41 commits into
barrulus:mainfrom
AmmoniumX:barrulus/main
Oct 31, 2026
Merged

AmmoniumX merged 41 commits into
barrulus:mainfrom
AmmoniumX:barrulus/main

Conversation

@AmmoniumX

Copy link
Copy Markdown
Collaborator

This is a larger PR than usual because it had to resolve several merge conflicts regarding how both branches have made changes to how actions are treated (multi-action binds vs bounded actions)

Key fixes/resolutions:

  • BoundAction holds lists: Press(Vec), Release(Vec), Both { press, release }. The helpers became press_actions() / release_actions() / into_actions().
  • Parsing keeps upstream's checks: no mixing plain actions with sections, no duplicate sections, no release on scroll binds, release-only binds can't repeat.
  • It also keeps this branch's checks: one bad action doesn't hide errors in the others, allow-when-locked requires every action (press and release) to be spawn, and toggle-keyboard-shortcuts-inhibit anywhere in the bind turns off inhibiting.
  • Lock screen: a bind runs if any action in the current press or release is allowed, and the disallowed ones are skipped one by one, as before. Upstream's rule that a release always runs once its press did still holds.
  • Hotkey overlay / MRU: a press or release with several actions isn't shown in the overlay and doesn't map to an MRU action. Single actions work as in upstream.

Things that needed judgment:

  • Carousel Enter (src/input/mod.rs): upstream moved the overview's Escape/Return/arrow keys into the normal bind list. Carousel-lens Enter now steps in when the matched bind is that built-in Return → toggle-overview bind.
  • Upstream test changed: mru_ignores_generic_modifier_binds failed in 3 snapshots. This branch's headless test backend always creates a renderer, so the screenshot UI opens for real in tests, and upstream's doesn't. Updated those snapshots and added a comment explaining why.
  • niri.rs: these conflicts were about the xkb keymap file, not binds. Combined upstream's change (it now reads the file while parsing the config) with this branch's per-keyboard settings.
  • Built-in binds: the overview and screenshot binds were const arrays, which can't hold a Vec. They're now LazyLock statics.
  • Docs: added a press/release example to the "Multiple Actions" section of docs/wiki/Configuration:-Key-Bindings.md.

HigherOrderLogic and others added 30 commits October 19, 2026 08:33
keysym_from_name() calls CString::new(key).unwrap().
- Use a Vec instead of a HashMap
- Update the recent_windows version to match the normal one,
  printing the duplicate bind
This intentionally introduces a new config parse error:

binds {
    Alt_L { spawn "alacritty"; }
    Alt+Alt_L { spawn "alacritty"; }
}

This used to parse before (only one of the binds worked though). Now
these are considered the same bind, so this config will error
accordingly.
There's a small behavior change: pressing a bind that is on a cooldown
and has repeat=true won't start the key repeat (it used to). The reason
is that for Press+Release keys it would make it annoying to track when
the release bind should fire (only after the first repeated key rather
than currently when it's recorded on press).
Remove all screenshot hardcoding in the code.

Behavior changes:
- Escape to close now works only when no modifiers are held.
- Other screenshot binds like Ctrl+C or Space used to ignore the state
  of some modifiers like Super, they now need them released.
- Repeat is disabled for screenshot binds, practically holding P won't
  repeatedly cycle the pointer.
- Inside the screenshot UI, the screenshot binds take precedence over
  allowed configured binds (e.g. if you configured Ctrl+C to spawn, or
  binds with MouseLeft).
Arguably more semantically correct, and will avoid running some
unnecessary loops in the future.
More semantically correct. If you have Escape on some xkb layer, why
wouldn't it work to hit it?
See the comment in the code.

First we search for modified because that's the symbol that was actually
input. Fixes cases like Mod+odiaeresis binds falling back to a ASCII
bind unnecessarily, or Mod+Shift+/ on a Russian layout with its \ / key.

Then we search for layer-0 current layout, which makes non-ASCII binds
case-insensitive too.

Then we search for a layer-0 ASCII key on other layouts, but only if raw
isn't ASCII itself. This is the required fallback for Russian binds.

Another thing this commit changes is that dead keys now get ASCII
fallback too.
@github-project-automation github-project-automation Bot moved this to Todo in Biri Oct 31, 2026
@AmmoniumX
AmmoniumX merged commit db9c2fa into barrulus:main Oct 31, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Biri Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants