I’ve had a problem in several games, and I don’t really no where to to being debugging it. It’s not like there is any error message. Is it my DE? my distro? drivers? proton? the game engine itself?
I’ve done some basic web searches, and all of the answers are hyper specific, or “alt-tab just breaks some times”.
The actual problem: When I alt-tab, some games will appear to freeze when I tab back in. I’ve noticed that while I am holding alt-tab and have a non-game window selected, the game is not frozen. As long as have not selected the window I am trying to swap to, it keeps running. It’s almost as if the game has inverted it’s internal state of whether it’s in the foreground are not.
(if it does matter, I am using Gnome on 22.04 PopOS, Nvidia 565 driver, Steam/Proton).
You could try using Gamescope to contain the game. I’m on Sway and some full screen games can confuse it on multiple monitors, this usually fixes it.
gamescope -w 1920 -h 1080 %command%
I’ll give it a try. I’ve seen as a solution to multiple problems, so probably a good tool to learn.
Does this happen when running the game in fullscreen mode aswell as in bordless? AFAIK, when u launch a game in fullscreen more resources are given to this specific resource/game. Therefore, when trying to switch windows/tabs the system will hang more easily as it takes more computing to load the desktop again.
Take this with a grain of salt I’m no expert. Would also be interesting to see what specs your computer is running. Personally used to have these sort of issues back when I had games running in an HDD, but since moving to SSDs+new higher specs its not really an issue anymore.
From my many decades of windows gaming, I always run in borderless window mode if I think I need/want to tab out.
I’m running on a laptop, but it’s fairly high end: 13th gen i9, 4070, 64GB of RAM, and only a SSD.
Disclaimer: Theory, based loosely on related experiences in Windows ages ago back when I actually used Windows.
The keyboard handler might be getting confused when you Alt+Tab, leaving the game stuck thinking you’re still holding Alt+Tab when you return to the game.
Just for shits and giggles, the next time you experience this, try tapping Alt once or twice to see if that refreshes the keyboard buffer and status.
You might even try tapping the other toggle/special keys as well, such as Ctrl, Shift, Esc…
I realize Windows and Linux are like comparing bananas to oranges, but still, the keyboard buffer might not be getting refreshed properly when switching apps.
It’s worth a try, do let us know if this helps in any way.
I’ve tried every key combo I could think of, and it didn’t seem to help. However I started using super-D to swap workspaces instead, and I have not hit the problem so far.
Ah, interesting, glad you found a workaround at least.
That makes sense really, it highly suggests that the game has trouble passing keyboard control off to the operating system when using hotkeys that the game has available for gameplay, but since the Super key is handled only by the operating system, that doesn’t confuse the game.
👍
This has happened to me when playing older games on Linux
Sounds plausible.
FWIW, New World (doesn’t have borderless fullscreen) got me into the habit of tapping the Windows key before doing anything outside the game. Other than when the game is starting, it never has any problems when I do that.
I’m using EndeavourOS, KDE, Wayland, so YMMV.
Not an explanation or proper fix, but running the games through Gamescope might fix it by side effect. In gamescope the game would never lose focus and so shouldn’t have problems resuming afterwards.
Try opening the Nvidia control panel, turn off Force Composition Pipeline. I had this same issue.
You comment led me down another rabbit hole: I don’t have that setting in my control panel, and apparently am missing several whole sections. An extra detail: I’m using a laptop with both integrated and discrete graphics. I tried launching a game and seeing if more settings would show up, but that didn’t seem to work. Apparently they are only consistent with an attached monitor.
You certain? You should have it. I have a very similar setup to you. Nvidia 3070, PopOs on a laptop with Gnome. Its kinda hidden in the app. There is an advanced button that hides the option.
Might be game specific. I don’t know how to solve the issue but maybe you could try opening the game in a different virtual desktop and switching desktops and see if that causes it. Or press the meta key and see if that causes it too
This has been working so far! Thanks for the suggestion. (I’ve had the same problem in more than 1 game).
Most probably graphics / nividia issue. But not a general issue, related to the configuration or hardware or something.
For most such cases when you can’t figure out anything, it’s generally a good idea to ask in your distro’s support forum. There are people who can usually help you debug a few things. It doesn’t always solve your problem, but you can get some possible pointers.
I’ll give it a try. I’ve seen as a solution to multiple problems, so probably a good tool to learn.
Thanks. I think this it best general answer (don’t solve my specific problem, but for sure answers how to best get help.)
sudo dmesg -Tw
It could be a game issue. I remember a lot of games had issues with alt-tabbing back when I used windows. It could also be a Wine issue. I had one game that started freezing when alt-tabbing after a Wine update a couple months ago. Rolling back to the previous version fixed it.