First post, by asdf53
Sadly, this hasn't been fixed yet as of Dosbox 0.74-3, running Windows 10. You can try this yourself:
Use the default config file, but change this line:
priority=higher,normal
to:
priority=higher,pause
Then, start Dosbox and run any game. While playing, press alt+tab to leave Dosbox, then press alt+tab again to return. The game will drastically slow down each time you press alt+tab. This becomes obvious when you press alt+tab ten times in a row. For example, Quake will eventually run at 1 fps. Also, it doesn't have anything to do with the keyboard. You can also leave Dosbox by clicking the mouse outside the window, then bring it back by clicking the taskbar icon. Same effect.
What's interesting is that pressing the PAUSE key to pause and unpause does not slow down the game. This means that the bug is not in the code that pauses Dosbox. It must be the code that processes the events that send the window into the background and foreground. Maybe an infinite loop or recursion somewhere because of how severe the slowdown is?
I can also see that someone opened a bug ticket at sourceforge: https://sourceforge.net/p/dosbox/bugs/367/ but it hasn't been fixed yet. I'm not a programmer myself, but I will try to look at the code and figure out what the problem is. I suspect the file we need to fix is "src/gui/sdlmain.cpp", because that's where the pause functions are. Let's hope this can be fixed somehow.