Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DXGI MakeWindowAssociation constants #960

Open
wants to merge 1 commit into
base: 0.3
Choose a base branch
from

Conversation

Herschel
Copy link

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 <[email protected]>
Copy link
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