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.