[PR #2906] [MERGED] Open windowed after the window system kills the game in fullscreen #4681

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2906
Author: @kacpherek
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/2904-fullscreen-crash


📝 Commits (1)

  • 22cab3e Open windowed after the window system kills the game in fullscreen

📊 Changes

1 file changed (+26 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+26 -2)

📄 Description

What and why

Part of #2904. On the reporter's Linux machine (CachyOS, NVIDIA 615.78.08, Vulkan), F11 crashed the game with winit's Exit Failure: 1. From then on the game crashed on every launch, because F11 had already saved fullscreen:true, and the window is created fullscreen when options.txt says so.

Exit Failure: 1 is what winit's Linux event loop returns when the window system fails. On Wayland that means the compositor dropped the connection after a protocol error (platform_impl/linux/wayland/event_loop/mod.rs:284-298), and on X11 a failed dispatch. libwayland prints the protocol error itself on stderr, so it never reaches latest.log, and the cause can't be read from the report.

This PR stops the crash loop. When the event loop ends with EventLoopError::ExitFailure while fullscreen is on, fullscreen is turned off in options.txt before the error goes on, so the next start opens windowed. It covers both event loops (the loading screen's App and run_event_loop) and logs a warning saying what happened.

The fullscreen failure itself isn't fixed here. I've asked the reporter in #2904 for the terminal output, which names the Wayland object and error, and for the desktop environment.

Vanilla reference

Vanilla has no such recovery: Window.toggleFullScreen and the Window constructor (created fullscreen from options.fullscreen) are what Horizon already follows. This only changes what happens after the window system has killed the game.

Self-check

cargo clippy -p horizon-client --all-targets -- -D warnings and cargo fmt --check pass. Not run in game: I can't reproduce it without Linux, Wayland and NVIDIA.


🔄 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/2906 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2904-fullscreen-crash` --- ### 📝 Commits (1) - [`22cab3e`](https://github.com/horizon-rust/horizon/commit/22cab3eeb3e057da2a54bb8d90fb93c06005d840) Open windowed after the window system kills the game in fullscreen ### 📊 Changes **1 file changed** (+26 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+26 -2) </details> ### 📄 Description ## What and why Part of #2904. On the reporter's Linux machine (CachyOS, NVIDIA 615.78.08, Vulkan), F11 crashed the game with winit's `Exit Failure: 1`. From then on the game crashed on every launch, because F11 had already saved `fullscreen:true`, and the window is created fullscreen when options.txt says so. `Exit Failure: 1` is what winit's Linux event loop returns when the window system fails. On Wayland that means the compositor dropped the connection after a protocol error (`platform_impl/linux/wayland/event_loop/mod.rs:284-298`), and on X11 a failed dispatch. libwayland prints the protocol error itself on stderr, so it never reaches `latest.log`, and the cause can't be read from the report. This PR stops the crash loop. When the event loop ends with `EventLoopError::ExitFailure` while fullscreen is on, `fullscreen` is turned off in options.txt before the error goes on, so the next start opens windowed. It covers both event loops (the loading screen's `App` and `run_event_loop`) and logs a warning saying what happened. The fullscreen failure itself isn't fixed here. I've asked the reporter in #2904 for the terminal output, which names the Wayland object and error, and for the desktop environment. ## Vanilla reference Vanilla has no such recovery: `Window.toggleFullScreen` and the `Window` constructor (created fullscreen from `options.fullscreen`) are what Horizon already follows. This only changes what happens after the window system has killed the game. ## Self-check `cargo clippy -p horizon-client --all-targets -- -D warnings` and `cargo fmt --check` pass. Not run in game: I can't reproduce it without Linux, Wayland and NVIDIA. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:10 +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#4681
No description provided.