-
Notifications
You must be signed in to change notification settings - Fork 162
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
fixes hang when alt+tab fullscreen direct3d game #1288
Conversation
If this is what Direct3D renderer does, then it's a mistake, it should create proper fullscreen by default. I think this should be normally fixed by expanding gfx mode to properly support both real fullscreen and borderless desktop window. |
Well, I can merge this as a temporary fix, if you confirm that it fixes the problem. |
I think the bordless "fake" Fullscreen is better, the other one has the "crash changes desktop resolution" bug. See #930 , which for now is entirely eliminated. |
It fixes in my computer but the person that reported didn't have a "hang" like I had, they reported a proper crash, which I could not reproduce. :( |
Engine needs to support both in the end. Regarding this fix, I am not certain if SDL window type really conflicts with Direct3D, because Direct3D supposed to handle window modes itself. This fix simply forces Direct3D renderer to always be in a windowed mode, so there may be other reasons why it works. |
I had not. But I just tried... And now I got a crash, when in Fullscreen, after a alt+tab! I changed ali3dd3d.cpp to use the error mentioned is as following:
Unfortunately is a super generic error. I need to sleep now before I mix something... |
Last question though, did fullscreen mode work correctly in before 3.6.0 (in allegro versions)? |
Yes, it works with 3.5.0.X versions of the engine in my Windows 10 computer, I can alt+tab from a fullscreen window and back without problem. |
Hm, after some thinking, I'd rather not apply such fix, but separate this into two tasks:
I'd begin with investigating how this flag is used in SDL2 source code, to make sure that it actually affects something (and what) in case when we do not create SDL_Renderer (and we only do that for the new software mode). |
Below is the function for the Direct3D renderer that is available (I think using the "Software" renderer), you can see in it's initialization it also needs to figure out if it's a "real" or "fake" Fullscreen there when setting the Windowed property. |
Yeah, I understand, I mean we can copy some of it's SDL Window handling. |
I am closing this since I understand a different approach is desired. |
I am leaving it reopened, but it's ok to close if a different decision is made - software is hard. :/ |
I'll add it as a temporary fix. |
Probable fix of #1287
My hypothesis: We are calling Reset on the direct3D device passing the d3dpp structure, and we are setting the Windowed property in it to false, but we are creating our window using
SDL_WINDOW_FULLSCREEN_DESKTOP
, which creates a "fake" fullscreen with a bordless window, so as far as Direct3D is aware, we have a Window, even in FullScreen.https://docs.microsoft.com/en-us/windows/win32/api/d3d9/nf-d3d9-idirect3ddevice9-reset