Option to not pause the game on losing focus

Moderator: GZDoom Developers

Kzer-Za
Posts: 516
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Option to not pause the game on losing focus

Post by Kzer-Za »

When the window with the game loses focus (e.g. you Alt-Tab somewhere), the game is automatically paused. Can an option be added please to disable this behavior? I think many people would have a situation when they need the game for some reason or the other to keep running while they are switched away.

Personally, I need to test some effect that takes a long time and don't want to waste this time, so I'd rather switch to some other window and do something else while I'm waiting.
User avatar
Rachael
Posts: 13793
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Option to not pause the game on losing focus

Post by Rachael »

Technically this is already doable as long as i_soundinbackground is enabled.

Please don't ask me why it's tied to that.

It should be split, in my opinion, into its own separate variable.
Kzer-Za
Posts: 516
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Option to not pause the game on losing focus

Post by Kzer-Za »

Oh, thanks, I didn't know that!
User avatar
Lemon King
Posts: 33
Joined: Thu Jul 15, 2021 10:01 am

Re: Option to not pause the game on losing focus

Post by Lemon King »

Better variable to set would be to set "vid_activeinbackground" to 1 in console.

From:
Graf Zahl wrote:This already exists. Set 'vid_activeinbackground' to 1 in the console and it should do what you want. For technical reasons this only works in windowed mode, not in fullscreen.
Kzer-Za
Posts: 516
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Option to not pause the game on losing focus

Post by Kzer-Za »

Just tried "vid_activeinbackground 1", but it seems to have no effect. When I switch away, the game is paused. Tested in windowed mode, of course.
Guest

Re: Option to not pause the game on losing focus

Post by Guest »

You should have them both:

i_soundinbackground 1
vid_activeinbackground 1
Kzer-Za
Posts: 516
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Option to not pause the game on losing focus

Post by Kzer-Za »

Ah, that's what it is. Then probably vid_activeinbackground is true by default? Because after the first answer here I just switched i_soundinbackground and that was enough. Then for testing the effect of vid_activeinbackground I switched i_soundinbackground back to off.
User avatar
Rachael
Posts: 13793
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Option to not pause the game on losing focus

Post by Rachael »

As I said, it's tied into the sound code.
User avatar
Rachael
Posts: 13793
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Option to not pause the game on losing focus

Post by Rachael »

Separated i_pauseinbackground and i_soundinbackground so that they are not tied together. Did it in Raze, too.

https://github.com/coelckers/gzdoom/com ... 2d48f641fe
https://github.com/coelckers/Raze/commi ... 22945d43d2 (commit was reversed due to issues)
i2van
Posts: 21
Joined: Thu Sep 10, 2020 2:48 am
Graphics Processor: Intel with Vulkan/Metal Support

Re: Option to not pause the game on losing focus

Post by i2van »

Add the following to the GlobalSettings of your gzdoom.ini:

Code: Select all

vid_activeinbackground=false
i_pauseinbackground=true
i_soundinbackground=false
Tested with GZDoom 4.9 nightly.

Return to “Closed Feature Suggestions [GZDoom]”