Page 1 of 1

Option to not pause the game on losing focus

Posted: Wed Jan 12, 2022 11:51 pm
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.

Re: Option to not pause the game on losing focus

Posted: Thu Jan 13, 2022 6:06 am
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.

Re: Option to not pause the game on losing focus

Posted: Thu Jan 13, 2022 6:46 am
by Kzer-Za
Oh, thanks, I didn't know that!

Re: Option to not pause the game on losing focus

Posted: Fri Jan 14, 2022 11:18 pm
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.

Re: Option to not pause the game on losing focus

Posted: Sat Jan 15, 2022 3:35 am
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.

Re: Option to not pause the game on losing focus

Posted: Sat Jan 15, 2022 5:59 am
by Guest
You should have them both:

i_soundinbackground 1
vid_activeinbackground 1

Re: Option to not pause the game on losing focus

Posted: Sat Jan 15, 2022 8:38 am
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.

Re: Option to not pause the game on losing focus

Posted: Sat Jan 15, 2022 10:10 am
by Rachael
As I said, it's tied into the sound code.

Re: Option to not pause the game on losing focus

Posted: Sat Jan 15, 2022 7:22 pm
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)

Re: Option to not pause the game on losing focus

Posted: Sat Jun 18, 2022 8:30 am
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.