[PR #1941] [MERGED] Preserve selected GUI scale across temporary small surfaces #3881

Closed
opened 2026-11-03 04:12:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1941
Author: @rdbtCVS
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: t3/preserve-gui-scale-setting


📝 Commits (1)

  • 40b3c1e Preserve requested GUI scale across temporary small surfaces

📊 Changes

4 files changed (+26 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+0 -10)
📝 crates/horizon-client/src/game/startup_menu.rs (+0 -2)
📝 crates/horizon-client/src/options_ui.rs (+0 -3)
📝 crates/horizon-client/src/settings.rs (+26 -7)

📄 Description

🤖 Opened by Bob's Codex agent (gpt-6.1-sol), not by Bob himself.

What and why

Fixes #1866.

Preserve the requested GUI scale when the initial loading surface or a resized window is smaller than fullscreen. For example, a saved scale of 6 now stays 6 through the reported 715×860 initial surface and 3400×1913 fullscreen surface; the renderer still limits the effective scale to 2 while the surface is small.

Remove the framebuffer-dependent mutations from loading and settings application. HudBatch::new already caps rendering per framebuffer, and explicit GUI Scale button clicks still cycle within the current framebuffer's range. Add regression coverage for saved values 0, 1, 2 and 6 across the two reported sizes, retaining the existing forward/reverse button-cycle tests.

Vanilla reference

Minecraft Java 26.3: com.mojang.blaze3d.platform.Window.calculateScale(int, boolean) and net.minecraft.client.Minecraft.resizeGui(), inspected with tools/rea_vanilla.py. Resizing calculates an effective scale from the option and applies it to the window without overwriting the selected option. Also inspected OptionInstance.ClampingLazyMaxIntRange.validateValue bytecode to distinguish explicit option validation from framebuffer changes.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 82b0051a3, 2 min 35 s)

Check Result
Scope ✅ 4 files, +26 −22
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ➖ no Python change
rustfmt ✅ (7 s)
clippy ✅ (3 s)
tests: horizon-client ✅ 1254 passed (2 min 6 s)
doc tests ✅ 0 passed (4 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 108 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 96 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Additional validation: cargo test -p horizon-client --lib gui_scale -- --nocapture passed all 3 selected tests. cargo clippy -p horizon-client --all-targets --locked -- -D warnings also passed independently.

Material limitations: full parity was started, then stopped at the user's request in favor of --quick; the complete parity suite has not passed locally. Native Hyprland/Wayland startup and fullscreen transitions were not reproduced interactively, so no compositor screenshots are supplied. The regression uses the exact two reported framebuffer sizes. This is client UI/settings handling shared by both single-player paths; no gameplay simulation code changes.

🤖 Generated with Codex (gpt-6.1-sol).


🔄 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/1941 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/preserve-gui-scale-setting` --- ### 📝 Commits (1) - [`40b3c1e`](https://github.com/horizon-rust/horizon/commit/40b3c1e3d68bf0c96d9eeb5b7c75cd207d0cf51d) Preserve requested GUI scale across temporary small surfaces ### 📊 Changes **4 files changed** (+26 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+0 -10) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+0 -2) 📝 `crates/horizon-client/src/options_ui.rs` (+0 -3) 📝 `crates/horizon-client/src/settings.rs` (+26 -7) </details> ### 📄 Description > 🤖 Opened by Bob's Codex agent (gpt-6.1-sol), not by Bob himself. ## What and why Fixes #1866. Preserve the requested GUI scale when the initial loading surface or a resized window is smaller than fullscreen. For example, a saved scale of 6 now stays 6 through the reported 715×860 initial surface and 3400×1913 fullscreen surface; the renderer still limits the effective scale to 2 while the surface is small. Remove the framebuffer-dependent mutations from loading and settings application. `HudBatch::new` already caps rendering per framebuffer, and explicit GUI Scale button clicks still cycle within the current framebuffer's range. Add regression coverage for saved values 0, 1, 2 and 6 across the two reported sizes, retaining the existing forward/reverse button-cycle tests. ## Vanilla reference Minecraft Java 26.3: `com.mojang.blaze3d.platform.Window.calculateScale(int, boolean)` and `net.minecraft.client.Minecraft.resizeGui()`, inspected with `tools/rea_vanilla.py`. Resizing calculates an effective scale from the option and applies it to the window without overwriting the selected option. Also inspected `OptionInstance.ClampingLazyMaxIntRange.validateValue` bytecode to distinguish explicit option validation from framebuffer changes. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 82b0051a3, 2 min 35 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +26 −22 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ➖ no Python change | | rustfmt | ✅ (7 s) | | clippy | ✅ (3 s) | | tests: horizon-client | ✅ 1254 passed (2 min 6 s) | | doc tests | ✅ 0 passed (4 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 108 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 96 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Additional validation: `cargo test -p horizon-client --lib gui_scale -- --nocapture` passed all 3 selected tests. `cargo clippy -p horizon-client --all-targets --locked -- -D warnings` also passed independently. Material limitations: full parity was started, then stopped at the user's request in favor of `--quick`; the complete parity suite has not passed locally. Native Hyprland/Wayland startup and fullscreen transitions were not reproduced interactively, so no compositor screenshots are supplied. The regression uses the exact two reported framebuffer sizes. This is client UI/settings handling shared by both single-player paths; no gameplay simulation code changes. 🤖 Generated with [Codex](https://openai.com/codex/) (gpt-6.1-sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:59 +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#3881
No description provided.