gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.36k stars 547 forks source link

DX11/12 backends automagically install an Alt+Enter fullscreen handler #3477

Closed Herschel closed 3 years ago

Herschel commented 3 years ago

Currently, the DX11/DX12 backends will allow a user to toggle to fullscreen by pressing Alt+Enter. This is inconsistent with the other backends, which provide no such behavior. You can see this in the gfx-rs examples:

cargo run --bin quad --features dx11

and pressing Alt+Enter, which will fullscreen even though there is no code in the app specifically handling this.

This behavior seems to be automatically installed by DXGI, and is controlled by this method: https://docs.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgifactory-makewindowassociation I guess this is enabled by default and needs to be explicitly disabled by calling with DXGI_MWA_NO_ALT_ENTER.

Ideally this would be disabled by default for the DX backends to maintain consistent behavior, or at least provided as an option.

Short info header: