-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Disable DXGI window management features for swap chains owned by the backend #4350
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
base: docking
Are you sure you want to change the base?
Disable DXGI window management features for swap chains owned by the backend #4350
Conversation
Note that the DirectX 12 sample also requires #4348 for Alt+Enter to work. For your convenience here's the two branches combined. There is an outstanding bug where if you use Alt+Enter fullscreen on the main viewport when it is on the same monitor as a secondary viewport, you'll get a debug layer crash. (This is the problem that prompted #4347 (comment)) There seems to be some sort of weird interaction where the secondary viewport's command queue is referencing the main viewport's back buffer. I have not had time to fully dive into this issue, but I'm considering it to be its own bug to be fixed separate from #4348 and this PR. |
I think we should not change DXGI window event handler in backend because some application need these feature and handle it correctly. |
51d9cd6
to
b56c8b0
Compare
…itions are disabled. Simplified MakeWindowAssociation calls in examples.
b56c8b0
to
6f2450d
Compare
@Demonese The backend change only disables it for backend-created windows. It doesn't touch the main viewport window so applications are free to leave it enabled there. I updated the changelog and related comments in the examples to clarify this.
If you have multiple viewports enabled, I'm fairly certain automatic DXGI fullscreen transitions cannot ever be handled 100% correctly. (They certainly don't work right in the docking branch examples.) Applications which want Alt+Enter fullscreen should handle |
In addition to clarifying the comments, I reduced the flags we pass to Originally I specified all three out of habit as a "Please don't touch my WndProc!". I decided to leave it that way for secondary viewports since I felt it better matched the intent there. For whatever reason |
By default, a swap chain created by DXGI will have the behavior of automatically fullscreening the window when the user presses Alt+Enter. This doesn't make a ton of sense for secondary swap chains for windows owned by the backend, this PR disables this feature.
How this feature works with multiple swap chains varies between versions of DirectX: (Based on my observations, I don't think this is documented anywhere.)
As such, this PR also disables window management for the main viewport window in the DirectX 10 and 11 examples (including the SDL DirectX11 sample.)
If we do not want to recommend/require disabling DXGI's window management on the main viewport for DirectX 10/11, we will need to recommend/require people handle Alt+Enter on the main viewport themselves. (This is considered best practice on Windows 10 anyway*)
(*Sorry for no source for this claim, this comes from my own notes on the DirectX presentation model. It probably comes from here or a random Microsoft Docs page. IIRC, the reasoning is that the default fullscreen transition does a bunch of extra junk to emulate legacy behaviors that are usually unnecessary.)