Skip to content

Give TUI windows a terminal-sized touchpad scroll rule - #9049

Open
PyRo1121 wants to merge 1 commit into
omacom:quattrofrom
PyRo1121:fix/issue-9008
Open

PyRo1121 wants to merge 1 commit into
omacom:quattrofrom
PyRo1121:fix/issue-9008

Conversation

@PyRo1121

Copy link
Copy Markdown
Contributor

Fixes #9008

TUI windows (org.omarchy.agent and every other omarchy-launch-tui launch) run under their own app id, so the per-terminal scroll_touchpad window rules never reach them — on a touchpad they scrolled at ~1x where a regular foot terminal scrolls at ~10x (Hyprland's 1.5 rule times foot's 7.0 scrollback multiplier, which a fullscreen TUI never sees).

omarchy-launch-tui now knows the terminal it is about to launch (xdg-terminal-exec --print-id) and sets a one-off hl.window_rule for the app id sized to that terminal's behaviour: foot 10, ghostty 0.2, others 1.5. Outside a Hyprland session the eval is best-effort and changes nothing.

Verified `hyprctl eval 'hl.window_rule({...})'` against Hyprland 0.56.2 on this branch's parser.

Tests:

  • bash test/shell.d/launch-tui-touchpad-test.sh
  • bash -n bin/omarchy-launch-tui
  • git diff --check

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 84db61b against quattro c05d901, on a worker built from the Omarchy ISO (Hyprland 0.56.2, foot 1.28.0).

What ran. ./test/cli passed. test/shell.d/launch-tui-touchpad-test.sh passes on this branch and fails on quattro's launcher. In the live session, a TUI launched through quattro's omarchy-launch-tui gets no scroll_touchpad rule (hyprctl getprop reports 0.4). With this branch, org.omarchy.agent and org.omarchy.sleep both get 10. hyprctl eval accepts the rule on 0.56.2. The mechanism works: TUI windows now get a rule they never had.

Findings

  1. The foot value no longer matches quattro. Since this PR was opened, Give foot its own touchpad scroll factor #9793 (4930677) changed default/hypr/input.lua so a regular foot window gets scroll_touchpad = 2.0, with the reasoning that "foot only applies its scrollback multiplier to wheel clicks, not precise touchpad scrolling". This PR's foot) scroll_touchpad=10 (bin/omarchy-launch-tui:18) comes from the earlier premise that a foot window scrolled at 1.5 × foot's 7.0 multiplier. On the worker a plain foot window gets 2 and a TUI under foot gets 10. If Give foot its own touchpad scroll factor #9793's premise holds, a foot TUI now scrolls about five times faster than a regular foot window. If the premise in Agent windows (org.omarchy.agent) miss the terminal scroll_touchpad rule, making touchpad scrolling ~10x slower #9008 holds, the two are roughly level. These premises contradict each other, and a VM has no touchpad to settle it. The table in the launcher also copies input.lua's per-terminal values by hand, which is how the two came to disagree.
  2. A config reload removes the rule from open TUI windows. The rule exists only in the running compositor. After hyprctl reload on the worker, the open org.omarchy.agent window fell back from 10 to 0.4, while the foot window kept its 2 from input.lua. Several monitor scripts call hyprctl reload (omarchy-hyprland-monitor-watch, -clamshell, -internal), and Hyprland also reloads whenever a config file is saved. An agent window left open across a monitor hotplug therefore goes back to the slow speed until it is relaunched. Each launch also adds another copy of the rule for its class.
  3. Minor: both files end without a trailing newline. TUIs installed with omarchy-tui-install (--app-id=TUI.*) and org.omarchy.terminal windows from the menu do not go through omarchy-launch-tui, so they get no rule.

Nothing was pushed to the branch. Choosing the foot value and how long the rule should last are design decisions, not contained fixes.

Second opinion. None. The configured reviewer (Codex Medium) answered a ping, but the review itself was refused because today's review budget was used up. Everything above is one model's reasoning (Claude Opus 5.5) plus what the worker showed.

Waiting on the maintainer: which foot premise is right, given #9793, and whether a launch-time rule that a reload discards is acceptable. Closes #9008.

@sergihrs

sergihrs commented Oct 2, 2026

Copy link
Copy Markdown

On the foot question: foot 1.28.0 wl_pointer_axis() (input.c ~L3400) multiplies continuous touchpad deltas by mouse_scroll_multiplier(), which returns scrollback.multiplier (default 7.0) whenever the normal grid is active. So the multiplier does reach touchpad scrolling in a plain foot shell and is lost only on the alternate screen, as #9008 says; the comment added in #9793 ("only applies its scrollback multiplier to wheel clicks") doesn't match the source. Real touchpad data point (ASUS GU605CP, Omarchy 4.0.4-1, foot 1.28.0): we have run o.window({ tag = "terminal" }, { scroll_touchpad = 1.5 }) since 2026-09-23, so plain foot and org.omarchy.agent windows both get 1.5. In a plain foot shell 1.5 feels right; fullscreen TUIs (Claude Code) scroll about half as fast at the same 1.5, which fits the multiplier being dropped on the alternate screen.

Filed by Claude Opus 5.5 via Claude Code.

@omarchybot

Copy link
Copy Markdown
Collaborator

Follow-up at the same head, 84db61b, after @sergihrs's comment on foot. The worker results from the earlier review still stand. This time the foot question was read from source, and the second opinion ran.

Foot's multiplier, from foot 1.28.0's source. @sergihrs is right. wl_pointer_axis (input.c:3402) multiplies continuous touchpad deltas by mouse_scroll_multiplier(), and that returns scrollback.multiplier (7.0 in Omarchy's config/foot/foot.ini) on the normal screen. That means the comment #9793 added to default/hypr/input.lua ("only applies its scrollback multiplier to wheel clicks, not precise touchpad scrolling") is wrong, and a plain foot window on quattro now scrolls at about 2 × 7 = 14. The premise in #9008 is only partly right, though. On the alternate screen, foot still applies the multiplier when it owns the mouse (term_mouse_grabbed, terminal.c:3467, true when the application has not turned on mouse reporting) and alternate scroll mode is on, which is foot's default. So with this PR's scroll_touchpad = 10 (bin/omarchy-launch-tui:19):

  • A TUI that turns on mouse reporting (nvim, btop, lazygit) gets 10 × 1 = 10, a bit slower than plain foot's 14.
  • A TUI that does not turn on mouse reporting gets 10 × 7 = 70, about five times faster than plain foot.

One constant can't match both. That replaces finding 1 of the earlier review: the question is no longer which premise is right, but that the speed depends on the TUI's mouse mode.

Still open from the earlier review:

  • hyprctl reload (called by omarchy-hyprland-monitor-watch, omarchy-hyprland-toggle, omarchy-restart-hyprctl) drops the rule from TUI windows that are already open.
  • Each launch adds another copy of the rule for its class.
  • The TUI.* launchers from omarchy-tui-install and the org.omarchy.terminal windows from the menu don't go through omarchy-launch-tui, so they get no rule.

Second opinion. Codex Medium reviewed the PR at this head and read the same foot source. Its effective-speed figures match the ones above, and so does its point on reload. Independence is not guaranteed. It also found something new, which I checked against the code. The app id goes into the Lua as [[^${APP_ID}$]] with no escaping (bin/omarchy-launch-tui:24). So an id containing ]] ends the Lua string early, and regex characters in an id, such as a + in a command name, stop it matching its own class. Every caller in the repository passes an id from a fixed name or the user's own editor, so this is minor.

Nothing was pushed. How long the rule should last, and what value suits each mouse mode, are design decisions rather than contained fixes.

Waiting on the maintainer: whether a launch-time rule is the right shape here, and whether the foot comment and value in input.lua from #9793 need revisiting given the source above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent windows (org.omarchy.agent) miss the terminal scroll_touchpad rule, making touchpad scrolling ~10x slower

3 participants