woof
woof copied to clipboard
Blackscreens my entire computer upon pressing windows key
It seems like if I have the game in fullscreen, specifically exclusive fullscreen, then press the windows key, no issues, but when I then renenter the game and press the windows key to exit again (both times with the game unpaused), my whole screen goes black forever, and nothing fixes it except restarting the computer. Alt f4, task manager, ctrl alt delete, nothing. Please fix. It happens consistently
I can't reproduce it on Windows 10. Maybe you accidentally turned off the display backlight? (Win + F5 on my laptop)
I'm on windows 11, I can reproduce it consistently, and win + F5 doesn't do anything unless I press Fn.
I got a black screen in Windows 10, it's inconsistent and I can get rid of it with Alt-Tab. Looks like a Windows problem, we don't do anything with the Win key in the code. So should we disable the Win key altogether?
Did @kw-create try Alt+Tab instead of the Windows key? Just to confirm that only the latter has the issue.
alt+tab back into doom is the only thing that fixes it. Still happens almost 100% of the time. I can also cause the issue by using alt + tab instead of pressing the windows key.
I just dealt with a slightly bad undervolt that would cause crashes alt-tabbing basic games even though running demanding raytraced stuff was OK. Something about instability at relatively light loads and things boosting weirdly and crashing. Any chance you've done something similar?
I just dealt with a slightly bad undervolt that would cause crashes alt-tabbing basic games even though running demanding raytraced stuff was OK. Something about instability at relatively light loads and things boosting weirdly and crashing. Any chance you've done something similar?
I can replicate the issue, it's related to how "Exclusive Fullscreen" works on Windows with some drivers/hardware. Not sure if we can fix it.
Using SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS
seems to be a workaround. Maybe on Windows platforms this should be set when using exclusive fullscreen, and unset otherwise.
Using
SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS
seems to be a workaround. Maybe on Windows platforms this should be set when using exclusive fullscreen, and unset otherwise.
I've tried this:
diff --git a/src/i_video.c b/src/i_video.c
index ecd69b6..fd47b8e 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1562,6 +1562,8 @@ static void I_InitGraphicsMode(void)
}
// [FG] exclusive fullscreen
flags |= SDL_WINDOW_FULLSCREEN;
+ SDL_SetHintWithPriority(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1",
+ SDL_HINT_OVERRIDE);
}
else
{
Still the same problem. It's inconsistent on my system, but after a few tries I get a black screen again. Can you reproduce this?
Can you reproduce this?
Sorry, I was mistaken. I had capped fps, which doesn't seem affected by this bug (alt+tab is fine). With uncapped fps, I can reproduce the bug and SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS
doesn't seem to help.
Disabling "batching" just before window creation seems to fix it. I'm not entirely sure why or what the consequences might be. This also seems to lower input latency.
diff --git a/src/i_video.c b/src/i_video.c
index ecd69b67..a84655f9 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1576,6 +1576,8 @@ static void I_InitGraphicsMode(void)
I_GetWindowPosition(&window_x, &window_y, w, h);
+ SDL_SetHint(SDL_HINT_RENDER_BATCHING, "0");
+
// [FG] create rendering window
screen = SDL_CreateWindow(PROJECT_STRING, window_x, window_y, w, h, flags);
There is also SDL_HINT_WINDOWS_USE_D3D9EX
but I didn't need to set it.
SDL_HINT_RENDER_BATCHING
will be removed in SDL3: https://github.com/libsdl-org/SDL/commit/6ba90f77752ab0350f28fb228c5dde550244904e
SDL_SetHint(SDL_HINT_RENDER_BATCHING, "0");
Yes, it works for me.
I always thought that "batch rendering" was the main difference between d3d9 and d3d11/d3d12 and the main reason for better performance. Hopefully this will be fixed in SDL3.
Fixed in https://github.com/fabiangreffrath/woof/commit/27214764335906e7dc22f04be0c6c16489dc6b30