Skip to content

Add DXGI MakeWindowAssociation constants#960

Open
Herschel wants to merge 1 commit intoretep998:0.3from
Herschel:dxgi-mwa-consts
Open

Add DXGI MakeWindowAssociation constants#960
Herschel wants to merge 1 commit intoretep998:0.3from
Herschel:dxgi-mwa-consts

Conversation

@Herschel
Copy link
Copy Markdown

Add constants used by IDXGIFactory::MakeWindowAssociation:

#define DXGI_MWA_NO_WINDOW_CHANGES      ( 1 << 0 )
#define DXGI_MWA_NO_ALT_ENTER           ( 1 << 1 )
#define DXGI_MWA_NO_PRINT_SCREEN        ( 1 << 2 )
#define DXGI_MWA_VALID                  ( 0x7 )

bors Bot added a commit to gfx-rs/gfx that referenced this pull request Nov 17, 2020
3479: [dx] Disable automatic Alt+Enter handling in DXGI r=kvark a=Herschel

Fixes #3477.

Uses [IDXGIFactory::MakeWindowAssociation](https://docs.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgifactory-makewindowassociation) to disable Alt+Enter behavior on dx11/dx12 backends.

 * winapi-rs does not have the `DXGI_MWA` constants (opened PR retep998/winapi-rs#960). Not sure where to cram these -- for now, I put them right beside the function call.
 * Using both `DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER`. Either of these seems to disable the Alt+Enter behavior; according to the docs, `DXGI_MWA_NO_WINDOW_CHANGES` seems more general, but I guess this is desired (DXGI shouldn't fiddle with anything automatically for consistent behavior among backends?).

PR checklist:
- [ ] `make` succeeds (on *nix)
- [ ] `make reftests` succeeds
- [x] tested examples with the following backends:
  - dx11, dx12, vulkan

Co-authored-by: Mike Welsh <mwelsh@gmail.com>
Copy link
Copy Markdown
Contributor

@MaulingMonkey MaulingMonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@roblabla roblabla mentioned this pull request Dec 4, 2020
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants