What causes RM to stop updating when unfocused?

I can't think of any reasons. Ideas?
Probably the player is running on a thread that is related to the window... and the window is basically "paused" when you unfocus it so it doesn't update... I guess they made it that way so that you won't need to worry about triggering some event than can cause like a game over when you unfocus on the window


Conclusion: It was a conscious design choice that they made


PS:


possibly this is the flow of things


A timer that ticks every frame


During each tick, it runs the update method of the current scene


Now when you unfocus the window, it runs the unfocus handler and stops the timer


When you focus, it runs the focus handler and restarts the timer
From experience, it seems most online games do this as well.

People used to say it was to help deter people from modifying the data from 3rd party programs while the game was running.

Seems pointless for non online games though...
Most of the standalone games I have stop running when the window/game loses focus. 

The most annoying thing about RM is that the game stops, but the audio continues.  I'd be happy for it to stop, if the BGM would pause too.
The Graphics module halts the ruby interpreter on an unfocused window during the update and transition methods (in VX when you msgbox or open the F1 options menu, it is also an implicit Graphics.update, not sure about VX Ace). When you refocus the window, processing continues from after the last frame. This is evidenced by the fact that you can run any number of methods between the time that the window loses focus and the next Graphics.update. It also exposes one of the reasons why processing doesn't continue in the background - the Input module makes no distinction on whether or not the window currently has focus when testing keypresses (although the ones sent to the window as messages, eg., F1, F12, ctrl-enter, need to have the window focused to work).


Unfortunately, I haven't found an easy way around it. Since Graphics controls the timing of the game, simply making a window focus check before Graphics.update runs is not enough, because the window can also lose focus while the update method is running to control the frame timing. Any kind of timing you could do using Time before handing control over to Graphics.update would be very roughshod comparatively, especially since the accuracy of Time depends on the processor clock resolution of the machine it is running on. Even if you could do the timing perfectly, Graphics.update also has to update the screen, which does take some time and having the window lose focus during this time will also pause the Ruby interpreter until focus is regained, so even that wouldn't be foolproof.

Original thread: https://forums.rpgmakerweb.com/threads/what-causes-rm-to-stop-updating-when-unfocused.25676/