[PR #5137] [MERGED] Options sliders: list the monitor's video modes once per monitor, not at every drag step #6096

Closed
opened 2026-11-03 06:11:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5137
Author: @Blzs2005
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/slider-video-modes


📝 Commits (1)

  • 3a88b63 Options sliders: list the monitor's video modes once per monitor, not at every drag step

📊 Changes

5 files changed (+78 additions, -12 deletions)

View changed files

📝 crates/horizon-client-input/src/window.rs (+55 -0)
📝 crates/horizon-client-render/src/settings.rs (+2 -1)
📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-client/src/game/options.rs (+7 -6)
📝 crates/horizon-client/src/game/startup_menu.rs (+9 -5)

📄 Description

🤖 Opened by Blzs2005's AI agent (Claude Code, Claude Opus 5.5), not by Blzs2005 personally.

Fixes #5133.

Dragging an Options slider was choppy: settings apply at every pointer move of a drag (Event::SliderDrag), and since 6907fe0a7 applying them listed the monitor's video modes each time. That takes about 28 ms on Windows (121 modes, timed with winit 0.30.13's MonitorHandle::video_modes), so nearly every frame of a drag stalled.

  • window::VideoModeList lists the modes once per monitor and keeps them until the window's monitor changes. It is generic over the monitor so its test needs no window.
  • apply_fullscreen (in game) and apply_menu_settings (startup menu) use it; Game and Loading each hold one.
  • Settings::with_option keeps video_modes: horizon-ctl options-set rebuilt Settings without them, and with the list no longer refreshed at every apply the Exclusive Fullscreen Mode row would have said unavailable.

A monitor's own mode list changing while the game runs (a resolution change in the system's settings) shows after the window moves to another monitor or the game restarts.

Checked by hand on Windows: sliders on the title screen's and the pause menu's Options follow the pointer smoothly, and Exclusive Fullscreen Mode still lists the monitor's modes.

pr_ready (tools/pr_ready.py --quick on Blzs, against origin/main at 3c68c05d0, 11 min 18 s)

Check Result
Scope ✅ 5 files, +78 −12
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 495 passed (1 min 36 s)
rustfmt ✅ (18 s)
clippy ✅ (1 min 50 s)
tests: horizon-client, horizon-client-input, horizon-client-render ✅ 2101 passed (7 min 7 s)
doc tests ✅ 0 passed (22 s)
content root tests ➖ content root untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5137 **Author:** [@Blzs2005](https://github.com/Blzs2005) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/slider-video-modes` --- ### 📝 Commits (1) - [`3a88b63`](https://github.com/horizon-rust/horizon/commit/3a88b6339f1c239d384d6661942153e931a78943) Options sliders: list the monitor's video modes once per monitor, not at every drag step ### 📊 Changes **5 files changed** (+78 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-input/src/window.rs` (+55 -0) 📝 `crates/horizon-client-render/src/settings.rs` (+2 -1) 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-client/src/game/options.rs` (+7 -6) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+9 -5) </details> ### 📄 Description > 🤖 Opened by Blzs2005's AI agent (Claude Code, Claude Opus 5.5), not by Blzs2005 personally. Fixes #5133. Dragging an Options slider was choppy: settings apply at every pointer move of a drag (`Event::SliderDrag`), and since 6907fe0a7 applying them listed the monitor's video modes each time. That takes about 28 ms on Windows (121 modes, timed with winit 0.30.13's `MonitorHandle::video_modes`), so nearly every frame of a drag stalled. - `window::VideoModeList` lists the modes once per monitor and keeps them until the window's monitor changes. It is generic over the monitor so its test needs no window. - `apply_fullscreen` (in game) and `apply_menu_settings` (startup menu) use it; `Game` and `Loading` each hold one. - `Settings::with_option` keeps `video_modes`: `horizon-ctl options-set` rebuilt `Settings` without them, and with the list no longer refreshed at every apply the Exclusive Fullscreen Mode row would have said unavailable. A monitor's own mode list changing while the game runs (a resolution change in the system's settings) shows after the window moves to another monitor or the game restarts. Checked by hand on Windows: sliders on the title screen's and the pause menu's Options follow the pointer smoothly, and Exclusive Fullscreen Mode still lists the monitor's modes. **pr_ready** (`tools/pr_ready.py --quick` on Blzs, against origin/main at 3c68c05d0, 11 min 18 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +78 −12 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 495 passed (1 min 36 s) | | rustfmt | ✅ (18 s) | | clippy | ✅ (1 min 50 s) | | tests: horizon-client, horizon-client-input, horizon-client-render | ✅ 2101 passed (7 min 7 s) | | doc tests | ✅ 0 passed (22 s) | | content root tests | ➖ content root untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:11:36 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6096
No description provided.