Let's say I'm playing a game. Alt-tabbing (losing focus) automatically pauses the game. I want to let the game continue even if I am not focusing on it.
How do I keep focus on a window even if I am focused on another window?
43 Answers
While this might have performance implications that are unacceptable for gaming, a variation on akira's answer that might work is to run the game program in a virtual machine. This question suggests that (at least on *nix hosts) VirtualBox does not tell the guest system if it loses focus.
If the game (or any other program) decides to pause when the focus shifts to another program than you have to live with that. The Window Manager creates a message which tells the window that has now lost the focus (mouse or keyboard focus) about that fact by using events / messages and then the application acts on that. Eg, a browser might decide to stop playing kittens on youtube when you switch over to your Excel spreadsheet at work. Or not.
6While not always available, most modern games have a 'Fullscreen (borderless)' video setting that may alleviate this issue you are experiencing with alt-tab.