CNA-BUG-179: Win32 EnterExclusiveFullscreen fails silently yet GetFullscreenMode reports ExclusiveFullscreen
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
EnterExclusiveFullscreen returns silently when a monitor-info, EnumDisplaySettingsW or ChangeDisplaySettingsExW step fails, though its comment says a refusal is reported; SetFullscreenMode still records ExclusiveFullscreen, so GetFullscreenMode misreports it.
- Identifier
CNA-BUG-179- Category
- Bug
- Subsystem
- Platforms
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- CNA::Platform::Win32::Win32Window::SetFullscreenMode(WindowFullscreenMode::ExclusiveFullscreen) and GetFullscreenMode()
Expected behaviour
EnterExclusiveFullscreen's comment says the display-mode change “is attempted for the window's own monitor, and a refusal is reported rather than silently downgraded into the borderless mode the caller did not ask for.” So a failed exclusive-mode change should surface, and GetFullscreenMode() should not claim exclusive fullscreen the window is not in.
Actual behaviour at TARGET
EnterExclusiveFullscreen first runs EnterBorderlessFullscreen, then returns silently if MonitorFromWindow/GetMonitorInfoW or EnumDisplaySettingsW fails, and sets exclusiveModeChanged_ only when ChangeDisplaySettingsExW returns DISP_CHANGE_SUCCESSFUL. On any of those failures nothing is reported and the window is left in borderless fullscreen, but SetFullscreenMode unconditionally sets fullscreenMode_ = ExclusiveFullscreen, so GetFullscreenMode() returns ExclusiveFullscreen. (The mode change also requests the monitor's current resolution, so exclusive fullscreen never changes the resolution.)
Source locations
modules/platform/src/Win32/Win32Window.cpp— EnterExclusiveFullscreen (silent early returns; exclusiveModeChanged_) and SetFullscreenMode (sets fullscreenMode_ regardless)
Evidence
Checked by reading EnterExclusiveFullscreen, LeaveFullscreen and SetFullscreenMode at 009d40f5. Not executed: exclusive fullscreen needs a real Windows display (Wine reports a fixed DPI and one monitor). The Development Win32 page records the comment/behaviour drift.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
Win32FullscreenStateTests.cpp and Win32WindowTests.cpp's fullscreen cases exercise borderless fullscreen and the windowed-state snapshot; no test drives exclusive fullscreen or a failed display-mode change.
Regression test
On a real Windows host (or a display abstraction), force ChangeDisplaySettingsExW to fail and require that either SetFullscreenMode reports the refusal or GetFullscreenMode() reports the mode actually in effect.
Blast radius
Windows games that request exclusive fullscreen on a monitor where the mode change fails; they run in borderless fullscreen while GetFullscreenMode() misreports exclusive.
Workaround
Treat borderless and exclusive fullscreen as interchangeable on Win32; do not rely on GetFullscreenMode() to confirm an exclusive-mode change.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Native platforms: Win32
- Internals
- Win32 platform internals: windows
- Maintainer workflow
- Modify a platform backend
- Known issues
- Bug index