Ubuntu – How to recover focus after losing it while using Wine


Sometimes when using Wine, specially with Games, doing ALT+TAB will make the system loose either keyboard or mouse focus over the current active window.

With this I mean that for example, if I do ALT+TAB from the Wine game to Nautilus, Empathy or another App and then try to go back to the game (May need to do this several times, about 3 to 4 should be enough), it will stay in Nautilus (The active window) or any other app, but the keyboard and mouse will be on the game.

If I try to ALT+TAB my way back, the ALT+TAB functionality is lost (Can not use it until I forcibly close the Wine game using for example wineserver -k on a terminal. So I will be left with a system that is showing me in foreground the nautilus app but the keyboard and mouse focus are on a minimized, background app (Wine Game for example).

So how can I either get the ALT+TAB back or be able to get focus on the current active window and be able to switch back and forth again. This can also happen to only one input, for example, the wine game might have the keyboard focused on it, but the mouse is not (Sometimes even lost and not usable until Wine is closed).

Best Answer

Switching desktops did the trick for me.

I use Openbox, and have hit this snag in FlStudio 10, it seems to me that the wineserver will allow you to alt-tab out, and back in, however sometime after doing it once it stops the alt-tab window from showing. Like I said I use Openbox, so my experience might be different, all I have to do is hold the alt button press tab once then proceed to switch desktops (mouse-wheel). since I don't use unity, I'm not certain that that is the default binding there, but it does seem to be a common binding. Do be careful some games/programs don't like this, for instance Command and Conquer 3 will almost certainly crash, be sure to save first!!!