Switching focus causes loss of keyboard and mouse on games

When I execute some games (most recently a gog unity game) with wine and switch focus, either between desktops or alt+tab, then I can’t use the keyboard or mouse on the game anymore.
I can still alt+f4 to quit the application, but I am unable to interact with the application itself.

Is there a way to remediate or prevent this?