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).

  • It looks like a bug.
    – edwin
    Aug 2 '13 at 4:25
  • What configuration you use for wine? Do you emulate a virtual desktop? Also the version of wine?
    – Braiam
    Aug 3 '13 at 22:28
  • Does not matter which version of Wine. All versions since 1.4 up to and including 1.6. For the focus part it also does not matter if I am emulating an specific resolution or not. Being testing this for 2 years at least. This is also not applicable to all apps, but some will take hold of the focus for one or both of the input devices. Give me a couple of days and I will add some more information since it happens most often with Unity. Aug 4 '13 at 0:40
  • Have you tried the rawinput patches? I'm not sure if they made it in to main or not, but some games used to have problems with input devices that got solved by the same. It seems like I read comments in the patch code about it being a kludgy work-around, but it seemed to work for some things I tried it to solve. Aug 7 '13 at 20:59
  • I found a solution for my problem in this thread. I had to add a string value in the registry as the last answer in this thread suggested
    – Modamod
    May 20 '19 at 21:13

I was able to solve this for my setup --- I'm using Wine play Hearthstone through Lutris. The trick is to edit the registry using regedit in Wine for this particular game, following this user's suggestion:

  • Open Regedit
  • Go to HKEY_CURRENT_USER\Software\Wine\X11 Driver
  • Create a new entry named "UseTakeFocus" with value "N"

This not only fixed my alt-tabbing issues, I was able to modify the window size and change between fullscreen and windowed mode in-game with only the expected behavior!

Specifically in Lutris, I selected the game (Hearthstone), clicked "Wine registry", and added the value in Regedit as suggested (when creating the new entry, it's right click, add key, String value; then right click modify it to make the value "N"). Then close out; the registry should be saved (but you can edit it again to double check that the new value is there). Then launch the game and the new behavior is in place.

I expect this doesn't work across games, because it depends the game having proper support for Desktop keyboard shortcuts and window management modifications.

  • 1
    Works for MTG Arena as well Apr 14 '20 at 14:50
  • 2
    Works for Among Us, can't believe this bug is still present to this day. Aug 22 '20 at 3:55

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!!!

  • Thanks spilt. For the crashes I am aware of several apps that do this. Will test what you mention when it happens again and provide results. Aug 7 '13 at 15:16
  • It does seems to get the focus back in KDE as well.
    – Letholdrus
    Aug 8 '13 at 7:14
  • np guys... glad to help! Aug 9 '13 at 9:45
  • Switching desktop worked for me. For me it is Alt+Ctrl+Left/Right, but I guess any way of doing that works.
    – donquixote
    Jan 12 '15 at 23:44
  • 3
    i can't believe this is still a bug, 5 years later.
    – Spongman
    Oct 31 '18 at 4:05

My solution is simple. before running the game turn on emulate virtual desktop in wine configuration>graphics

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.