[GH-ISSUE #1866] GUI Scale is clamped to 2 after restarting under Hyprland; preserved correctly with XWayland #558

Closed
opened 2026-11-02 15:40:01 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @qytlix on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1866

This report was investigated and drafted with assistance from gpt-6.1-sol. The reproduction tests were performed by the reporter. Translated from Chinese into English by AI.

Description

Under Hyprland 0.56.2-4, after launching the game through the desktop shortcut (Exec=horizon-launcher), setting GUI Scale in Options → Video Settings → Display, and then quitting and restarting the game, the manually selected scale may be clamped to a lower value.

  • In the initial tests, GUI Scale values of 3, 4, 5, 6, and 7 became 2 after restarting.
  • GUI Scale values of 1, 2, and Auto were preserved correctly.
  • After making the launcher window floating and then starting the game, values above 3 were observed to be clamped to 3. This change was made to the launcher window; how it affects the game window has not been confirmed.
  • In the same Hyprland environment, launching with env -u WAYLAND_DISPLAY horizon-launcher preserves the setting correctly.
  • The setting is also preserved correctly when tested under XFCE (X11).

Reproduction has only been confirmed in the Hyprland environment described above. Other Wayland compositors have not been tested, so this should not be treated as a general issue affecting all native Wayland environments.

Environment

  • OS: EndeavourOS (Arch Linux-based, x86_64)
  • Installation source: Arch Linux AUR, package horizon-launcher-bin
  • AUR package version: 1:0.2.7-1 (provides horizon-launcher=0.2.7)
  • Launcher version: 0.2.7; installed through the AUR binary package, not compiled locally from source
  • Horizon client: v0.2.57 (the game version installed by the launcher, listed separately from the launcher version)
  • Window manager / compositor: Hyprland 0.56.2-4
  • GPU: AMD Radeon 780M Graphics (RADV PHOENIX)
  • Graphics backend: Vulkan
  • Driver: radv Mesa 26.2.5-arch1.1
  • Saved settings before the reproduction run: guiScale:6, fullscreen:true, forceUnicodeFont:false

Steps to reproduce

  1. Under Hyprland, start Horizon launcher through the desktop shortcut, then launch the game, without unsetting WAYLAND_DISPLAY.
  2. Open Options → Video Settings → Display and set GUI Scale to 6.
  3. Quit the game normally and confirm that options.txt contains guiScale:6.
  4. Restart the game in the same way.
  5. Check GUI Scale: it has changed to 2.

Expected behavior

The selected GUI Scale of 6 should be preserved after restarting. Even if the effective rendering scale needs to be limited while the window is temporarily small, the user's saved selection should not be lost.

Actual behavior

After restarting, GUI Scale shows 2 instead of the previously saved value of 6.

Comparison test and logs

In the same Hyprland environment, start the launcher with the following command, then launch the game:

env -u WAYLAND_DISPLAY horizon-launcher

With this XWayland launch, GUI Scale 6 is preserved correctly.

The logs from the two runs show different initial rendering surface sizes:

Test Startup time Initial surface size Observed in the UI
Default launch, Wayland path 2026-10-25 23:58:32 715×860 GUI Scale changed from 6 to 2
WAYLAND_DISPLAY unset, XWayland comparison 2026-10-26 00:02:27 3400×1913 GUI Scale remained at 6

Wayland log:

[23:58:32] [Render thread/INFO]: Horizon renderer: device ready; configuring the surface (715x860 Bgra8Unorm, Mailbox)

XWayland comparison log:

[00:02:27] [Render thread/INFO]: Horizon renderer: device ready; configuring the surface (3400x1913 Bgra8Unorm, Mailbox)

Full logs attached:

Note: The window-system paths are labeled based on the launch methods and test results. The logs themselves do not explicitly identify Wayland/XWayland, nor do they directly record GUI Scale changes or subsequent resize events. Whether the clamped value is immediately written back to disk has not been confirmed.

This section has not been reviewed by a human and consists entirely of the AI agent's analysis and hypotheses.

PR #191 introduced logic that clamps the saved scale based on the framebuffer size. On the current main branch, Settings::clamp_gui_scale() directly modifies the setting:

let max = crate::window::calculate_scale(framebuffer, 0, self.force_unicode) as u32;
self.gui_scale = self.gui_scale.min(max);

References:

With this algorithm and forced Unicode disabled, the maximum scale is 2 for 715×860 and 7 for 3400×1913, matching the comparison results above.

The hypothesis is that, on the Wayland path under Hyprland, the client clamps the saved GUI Scale against a temporary window size before the fullscreen size is ready. The original selection is then not restored when the window becomes larger. However, no logging has been added to the clamping calls in v0.2.57, so the exact call sequence and root cause remain unconfirmed.

Workaround

Launch through XWayland:

env -u WAYLAND_DISPLAY horizon-launcher

Issue #134 / PR #150 addressed saved audio and GUI settings not being applied at startup. This report concerns a saved GUI Scale being clamped to a smaller value after restarting.

Originally created by @qytlix on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1866 > This report was investigated and drafted with assistance from gpt-6.1-sol. The reproduction tests were performed by the reporter. Translated from Chinese into English by AI. ## Description Under Hyprland 0.56.2-4, after launching the game through the desktop shortcut (`Exec=horizon-launcher`), setting GUI Scale in Options → Video Settings → Display, and then quitting and restarting the game, the manually selected scale may be clamped to a lower value. - In the initial tests, GUI Scale values of 3, 4, 5, 6, and 7 became 2 after restarting. - GUI Scale values of 1, 2, and Auto were preserved correctly. - After making the launcher window floating and then starting the game, values above 3 were observed to be clamped to 3. This change was made to the launcher window; how it affects the game window has not been confirmed. - In the same Hyprland environment, launching with `env -u WAYLAND_DISPLAY horizon-launcher` preserves the setting correctly. - The setting is also preserved correctly when tested under XFCE (X11). Reproduction has only been confirmed in the Hyprland environment described above. Other Wayland compositors have not been tested, so this should not be treated as a general issue affecting all native Wayland environments. ## Environment - OS: EndeavourOS (Arch Linux-based, x86_64) - Installation source: Arch Linux AUR, package `horizon-launcher-bin` - AUR package version: `1:0.2.7-1` (provides `horizon-launcher=0.2.7`) - Launcher version: 0.2.7; installed through the AUR binary package, not compiled locally from source - Horizon client: v0.2.57 (the game version installed by the launcher, listed separately from the launcher version) - Window manager / compositor: Hyprland 0.56.2-4 - GPU: AMD Radeon 780M Graphics (RADV PHOENIX) - Graphics backend: Vulkan - Driver: radv Mesa 26.2.5-arch1.1 - Saved settings before the reproduction run: `guiScale:6`, `fullscreen:true`, `forceUnicodeFont:false` ## Steps to reproduce 1. Under Hyprland, start Horizon launcher through the desktop shortcut, then launch the game, without unsetting `WAYLAND_DISPLAY`. 2. Open Options → Video Settings → Display and set GUI Scale to 6. 3. Quit the game normally and confirm that `options.txt` contains `guiScale:6`. 4. Restart the game in the same way. 5. Check GUI Scale: it has changed to 2. ### Expected behavior The selected GUI Scale of 6 should be preserved after restarting. Even if the effective rendering scale needs to be limited while the window is temporarily small, the user's saved selection should not be lost. ### Actual behavior After restarting, GUI Scale shows 2 instead of the previously saved value of 6. ## Comparison test and logs In the same Hyprland environment, start the launcher with the following command, then launch the game: ```sh env -u WAYLAND_DISPLAY horizon-launcher ``` With this XWayland launch, GUI Scale 6 is preserved correctly. The logs from the two runs show different initial rendering surface sizes: | Test | Startup time | Initial surface size | Observed in the UI | |---|---|---|---| | Default launch, Wayland path | 2026-10-25 23:58:32 | 715×860 | GUI Scale changed from 6 to 2 | | WAYLAND_DISPLAY unset, XWayland comparison | 2026-10-26 00:02:27 | 3400×1913 | GUI Scale remained at 6 | Wayland log: ```text [23:58:32] [Render thread/INFO]: Horizon renderer: device ready; configuring the surface (715x860 Bgra8Unorm, Mailbox) ``` XWayland comparison log: ```text [00:02:27] [Render thread/INFO]: Horizon renderer: device ready; configuring the surface (3400x1913 Bgra8Unorm, Mailbox) ``` Full logs attached: - [horizon-xwayland-gui-scale-preserved.log](https://github.com/user-attachments/files/33930421/horizon-xwayland-gui-scale-preserved.log) - [horizon-wayland-gui-scale-reset.log](https://github.com/user-attachments/files/33930422/horizon-wayland-gui-scale-reset.log) Note: The window-system paths are labeled based on the launch methods and test results. The logs themselves do not explicitly identify Wayland/XWayland, nor do they directly record GUI Scale changes or subsequent resize events. Whether the clamped value is immediately written back to disk has not been confirmed. ## Potentially related code (unconfirmed) > This section has not been reviewed by a human and consists entirely of the AI agent's analysis and hypotheses. PR #191 introduced logic that clamps the saved scale based on the framebuffer size. On the current main branch, `Settings::clamp_gui_scale()` directly modifies the setting: ```rust let max = crate::window::calculate_scale(framebuffer, 0, self.force_unicode) as u32; self.gui_scale = self.gui_scale.min(max); ``` References: - https://github.com/ludovic111/horizon/pull/191 - https://github.com/ludovic111/horizon/blob/1a91727eee5aaecafe9b50c21ca80efdb9f2d14f/crates/horizon-client/src/settings.rs#L286-L291 With this algorithm and forced Unicode disabled, the maximum scale is 2 for 715×860 and 7 for 3400×1913, matching the comparison results above. The hypothesis is that, on the Wayland path under Hyprland, the client clamps the saved GUI Scale against a temporary window size before the fullscreen size is ready. The original selection is then not restored when the window becomes larger. However, no logging has been added to the clamping calls in v0.2.57, so the exact call sequence and root cause remain unconfirmed. ## Workaround Launch through XWayland: ```sh env -u WAYLAND_DISPLAY horizon-launcher ``` ## Related but distinct issue Issue #134 / PR #150 addressed saved audio and GUI settings not being applied at startup. This report concerns a saved GUI Scale being clamped to a smaller value after restarting.
Author
Owner

@rdbtCVS commented on GitHub (Oct 25, 2026):

🤖 Agent: Codex agent is investigating this issue and preparing a small fix to preserve the selected GUI scale across startup window sizes.

<!-- gh-comment-id:6403256737 --> @rdbtCVS commented on GitHub (Oct 25, 2026): 🤖 Agent: Codex agent is investigating this issue and preparing a small fix to preserve the selected GUI scale across startup window sizes.
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#558
No description provided.