feat(config): add window update_mode option#131
Merged
Conversation
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>
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.
Closes #130.
Adds
[window] update_mode("Continuous"|"LowPower") and[window] frame_interval_ms, exposing the winitUpdateModeused while the window is focused.The default is unchanged.
update_modedefaults toContinuous, which takes the sameWinitSettings::continuous()path as today, so existing setups behave exactly as they do now.LowPowerrestores what 0.4.2 used:focused_mode: reactive_low_power(frame_interval_ms)withunfocused_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, soLowPoweronly changes the focused one.frame_interval_msdefaults to33, matching 0.4.2'sFOCUSED_UPDATE_INTERVAL.Measured on the setup from #130 (RTX 4080, Hyprland, 520x60 window, idle, same build — only the config differs):
Continuous)update_mode = "LowPower"The checks in CONTRIBUTING.md pass:
cargo check,cargo fmt --all -- --check, andcargo clippy --all-targets --all-features -- -D warnings.Two notes:
"Continuous"/"LowPower") to match the existing enum values inratty.toml(style = "Regular",action = "Copy") rather than the lowercase spelling I used in the issue. Easy to change if you'd prefer.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.