[Bug] `multimonitor` with fullscreen and a value greater than the number of displays results in out-of-range resolution requests
Open
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 869
- Forks
- 222
- Avg merge
- 18h 33m
- Merged PRs (30d)
- 1
Description
Steps to reproduce
- Connect two external displays to a Win11 system.
- Build EE off master and launch with
multimonitor=3(n+1, where n is the number of connected displays) andfullscreen=1.
Expected behavior
Either:
- EE launches into full screen on each display, each display runs at its native resolution, and a third "display" is opened as a window.
- EE ignores
fullscreen=1and opens three windows.
Observed behavior
EE launches into full screen on each display, but each display cycles endlessly into attempting to use an out-of-range resolution.
EE logs:
[DEBUG ]: SDL_GetDisplayBounds(display_nr, &rect) returned -1. display_nr: 2
[ERROR ]: SDL error in Window::calculateWindowSize() at SDL_GetDisplayBounds(display_nr, &rect): displayIndex must be in the range 0 - 1
[WARNING ]: SDL_GetDisplayBounds() returned a rect with at least one dimension < 240: 0,0
[DEBUG ]: Window dimensions before scaling loop: 1200,900
[WARNING ]: Window::calculateWindowSize() couldn't solve windowWidth and windowHeight in 16 attempts: 218,163
[DEBUG ]: Window::calculateWindowSize() reported at least one window dimension of < 240: 218,163
Falling back to 640,480.
Workarounds
- Exit full screen (Alt+Enter) on the primary display after launch. The mode switching loop stops and EE can be exited.
- Set
fullscreen=0and use windowed mode. EE opens three windows. - Ensure that the number of displays matches the value of
multimonitor. Re: #2701 these displays should likely also have the same native display resolution.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Window::calculateWindowSize() and the SDL_GetDisplayBounds() calls shown in the logs, reproducing with two displays, multimonitor=3, and fullscreen=1 on Windows 11. Trace how the out-of-range display index is handled. Done means the configuration no longer loops on invalid resolutions and follows one of the expected fullscreen or windowed behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100