Skip to content

feat(config): add window update_mode option#131

Merged
orhun merged 2 commits into
orhun:mainfrom
carltenzler-ctrl:expose-update-mode
Jul 17, 2026
Merged

feat(config): add window update_mode option#131
orhun merged 2 commits into
orhun:mainfrom
carltenzler-ctrl:expose-update-mode

Conversation

@carltenzler-ctrl

Copy link
Copy Markdown
Contributor

Closes #130.

Adds [window] update_mode ("Continuous" | "LowPower") and [window] frame_interval_ms, exposing the winit UpdateMode used while the window is focused.

The default is unchanged. update_mode defaults to Continuous, which takes the same WinitSettings::continuous() path as today, so existing setups behave exactly as they do now.

LowPower restores what 0.4.2 used: focused_mode: reactive_low_power(frame_interval_ms) with unfocused_mode: Continuous. Keeping unfocused continuous preserves the reasoning behind the current code — the comment notes that a reactive unfocused mode would delay background PTY output, and that rationale is about the unfocused mode, so LowPower only changes the focused one. frame_interval_ms defaults to 33, matching 0.4.2's FOCUSED_UPDATE_INTERVAL.

Measured on the setup from #130 (RTX 4080, Hyprland, 520x60 window, idle, same build — only the config differs):

Config CPU, one core
default (Continuous) 49.3%
update_mode = "LowPower" 7.85%

The checks in CONTRIBUTING.md pass: cargo check, cargo fmt --all -- --check, and cargo clippy --all-targets --all-features -- -D warnings.

Two notes:

  • I used PascalCase values ("Continuous" / "LowPower") to match the existing enum values in ratty.toml (style = "Regular", action = "Copy") rather than the lowercase spelling I used in the issue. Easy to change if you'd prefer.
  • No tests added — there's no existing test setup for config parsing, and the default path is unchanged. Happy to add some if you want them.

I'm not a Rust developer, and I used Claude to help write this patch. I've built and tested it on the machine from #130, and I'm glad to test any changes you'd like against that setup.

carltenzler-ctrl and others added 2 commits July 15, 2026 18:12
Expose the winit UpdateMode used while the window is focused via
`[window] update_mode` and `[window] frame_interval_ms`.

The default (`Continuous`) takes the same `WinitSettings::continuous()`
path as before, so existing behavior is unchanged. `LowPower` restores
0.4.2's settings: reactive_low_power while focused, continuous while
unfocused, so background PTY output is still not delayed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@orhun orhun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@orhun
orhun merged commit d7c4e3b into orhun:main Jul 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose winit UpdateMode as config — WinitSettings::continuous() costs ~10x idle CPU for small always-on windows

2 participants