fabiangreffrath / woof

Woof! is a continuation of the Boom/MBF bloodline of Doom source ports.
GNU General Public License v2.0
186 stars 32 forks source link

Black screen on alt-tab with exclusive fullscreen enabled #1752

Closed Dezaimasu closed 3 weeks ago

Dezaimasu commented 3 weeks ago

I have a problem with alt-tabbing with exclusive fullscreen enabled, it only happens when it's enabled. Most of the times I'm getting alt-tabbed to the black screen with only the mouse cursor in the middle, and I have to alt-tab back to the game, and sometimes repeat it multiple times before I can properly alt-tab from the game to the other application. Sometimes opening the map or pause menu before alt-tab helps. I ended up using "Win" key to alt-tab since the black screen happens rarer that way. Sometimes it alt-tabs just fine, even multiple times in a row, but most of the times it's a black screen.

Tested multiple version and it started with 14.1.0, version 14.0.0 or any prior version doesn't have such problem. Checked with fresh installations, "exclusive fullscreen" is the only changed option.

I tried to change some settings in nVidia control panel like G-Sync, refresh rate, color depth, etc., no difference. Updated nVidia drivers (using 551.86 right now), still no difference. Using Win10 x64 22H2.

Here's how it looks after the unsuccessful alt-tab, after I press alt-tab again without releasing the alt: image Or how it looks after I press the Win key: image

ceski-1 commented 3 weeks ago

Have you tried any of the development builds? For example, the artifact at the bottom of this page: https://github.com/fabiangreffrath/woof/actions/runs/9580151521

Dezaimasu commented 3 weeks ago

Just tried the ones you linked, both x32 and x64 versions, same behavior.

rfomin commented 3 weeks ago

Try setting the environment variable SDL_RENDER_DRIVER to direct3d11 or opengl. Run these commands in a Windows console ("Start"->cmd.exe):

cd "path to woof"
set SDL_RENDER_DRIVER=direct3d11
woof -verbose
NightFright2k19 commented 3 weeks ago

I can confirm this issue with latest dev builds.

rfomin commented 3 weeks ago

I can confirm this issue with latest dev builds.

It looks like we fixed a similar problem for some systems, but broke it in others. Could you please test different SDL_RENDER_DRIVER as in the post above?

Dezaimasu commented 3 weeks ago

With both direct3d11 and opengl the game al-tabs with no problems, checked with x64 dev build from above.

Minor notes: With direct3d11 the game stopped responding once when I turned off "exclusive fullscreen" mid-game, but it was only once, after I restarted the game I could change this option just fine. With opengl the game starts in the "background", I can hear the sounds but I don't see the game on my screen, only its button appears on the taskbar. But the game is actually running and it's on the front, when I click mouse anywhere I can hear it clicks on the game menu. I have to alt-tab back and forth to actually see the game.

Also alt-tabbing from the game with opengl back to Windows is a bit wonky, every time there's a black screen for a few split seconds before I see the actual application I was alt-tabbing to. With direct3d11 it's always instant, and it's also instant with empty SDL_RENDER_DRIVER, when the alt-tab works ofc.

NightFright2k19 commented 3 weeks ago

Pretty much the same for me.

What's the default setting for this, actually? Just in case I wanted to switch back.

rfomin commented 3 weeks ago

What's the default setting for this, actually? Just in case I wanted to switch back.

Default is "direct3d" on Windows, which is direct3d9.

In general, "Exclusive Fullscreen" is still buggy on Windows. Thanks for testing, maybe we should consider setting the default to "direct3d11".