Wine freezing when alt-tabbing out of game

Questions about Wine on Linux
Locked
AkitoApocalypse
Newbie
Newbie
Posts: 2
Joined: Tue Mar 06, 2018 12:53 pm

Wine freezing when alt-tabbing out of game

Post by AkitoApocalypse »

Note that I have found a workaround by emulating via the virtual desktop, but I'm not a fan of the virtual desktop and it does create some performance issues...
So, basically the game (Rimworld) would work perfectly fine if I run wine and keep the window focused; however, the moment I alt-tab out of the game, Rimworld would freeze up.

Basically, the following happen when I switch tabs:
-There's a tiny window of Rimworld on the top left of the screen, idk what that does
-No other screens focus, except for tilda which I have handy (and xkill does work to close Rimworld)
-Rimworld freezes, I think people referred to it as the program stopping redrawing or something?

Note: I did get this to work perfectly fine on xfce, but I decided to wipe and install gnome instead.
I have tried multiple wine versions, mainly staging, stable and development; none have provided any solutions.
I'm not sure what else to try, and google isn't giving any relevant information (or maybe I'm searching wrongly...)

System specs:
Chromebook pixel 2015 (intel graphics 5500)
Some i7 u processor?

I'd be happy to provide more information if needed. I'll post the log file in a bit.
AkitoApocalypse
Newbie
Newbie
Posts: 2
Joined: Tue Mar 06, 2018 12:53 pm

Re: Wine freezing when alt-tabbing out of game

Post by AkitoApocalypse »

Update: Nohup file located at: https://pastebin.com/AAZnRsVe

*Game does work with virtual desktop, but I would prefer not because it leads to some performance issues
*Game works windowed but this leads to some weird glitches and also performance issues - changing from windowed to fullscreen completely freezes everything but the mouse, can't even bring down tilda to xkill anymore.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine freezing when alt-tabbing out of game

Post by Bob Wya »

@ AkitoApocalypse

If you know the issue affects Gnome Shell (I presume) and not Xfce - then I'd suggest spinning up Plasma 5 and Mate Desktops.
See if the bug is only occurring in the Gnome DE. Certainly there have been bugs opened, of this nature, against Gnome for Wine support in the past.

Other things to consider:
  • Is it a dual monitor issue?
  • Is it a general problem for Unity games (using the same version of Unity) running Gnome/Wine?
Nothing useful in the log... Similar to my occasionally disappearing Steam window - on Plasma 5... :cry:

Bob
camiel
Newbie
Newbie
Posts: 2
Joined: Sun Apr 19, 2020 3:10 am

Re: Wine freezing when alt-tabbing out of game

Post by camiel »

Hi all, is there a fix yet for this problem? I am experiencing a similar issue. I run Kubuntu 19.10 (plasma 5.16.5), using wine 5 to play Star wars Knights of the Old Republic v 6.1.1. When I select another window, the game freezes and I cannot regain control. Sound keeps playing btw.

C
camiel
Newbie
Newbie
Posts: 2
Joined: Sun Apr 19, 2020 3:10 am

Re: Wine freezing when alt-tabbing out of game

Post by camiel »

Addition to the above, hearing from the sounds it seems my game continues (I can hear my character take damage and die). Just freezing of the screen and no control with keyboard/mouse.
The_Otter
Newbie
Newbie
Posts: 1
Joined: Sat Dec 26, 2020 9:34 am

Re: Wine freezing when alt-tabbing out of game

Post by The_Otter »

I'm having the same issue with among us. It works fine until I tab out, and then it stops responding to the keyboard, but the mouse is fine. I use Gnome 20.04. Is there a solution to this yet? :/
ThatLinuxNerd
Newbie
Newbie
Posts: 1
Joined: Wed Jul 21, 2021 1:15 pm

Re: Wine freezing when alt-tabbing out of game

Post by ThatLinuxNerd »

I have been having this exact issue in Xfce for some months now, and it's only been exacerbated by 1.3 (I can't even resize the window now without it crashing.)
invisible kid
Level 5
Level 5
Posts: 352
Joined: Tue Dec 24, 2019 3:23 pm

Re: Wine freezing when alt-tabbing out of game

Post by invisible kid »

I had an issue in Hearthstone where if I tabbed out it would stop registering mouse clicks. Definitely a different issue but with some similarities. The fix for the hearthstone issue was making a change via regedit:

https://forums.lutris.net/t/hearthstone ... mes/7727/2
Then navigate to HKEY_CURRENT_USER > Software > Wine > X11 Driver, then right click X11 Driver and add a new string “UseTakeFocus”, then modify the value to “N”.
It might not help with this issue, though.
Ancientone
Newbie
Newbie
Posts: 1
Joined: Wed Oct 13, 2021 1:19 pm

Re: Wine freezing when alt-tabbing out of game

Post by Ancientone »

Solution using Steam
If using Steam, simply add the “-force-opengl” argument to the games “launch options”, like so:

Right-click the game in Your Library, and click “Properties“
Then, click the “SET LAUNCH OPTIONS…” button under the “GENERAL” tab
Copy and paste the following code into the input field and click “OK“
-force-opengl

Note: Make sure to include the leading dash (–) sign.

For those of You out there also using the radeonsi driver, I would suggest that You also disable “vsync”, by including the “vblank_mode” parameter. This, for me, ensures that the game (and in particular, it’s main menu) does not freeze. If You are experiencing this issue, try adding the following to the games’ launch options instead:

vblank_mode=0 %command% -force-opengl

This effectively disables “vsync” as well as incorporating the aforementioned launch fix.

Non-Steam solution
If You are not using the Steam version of a Unity-based game, I would instead suggest that You create a bash script that incorporates this fix. Generally speaking, something along the lines of the following, should be sufficient:

#!/bin/bash
/path/to/game/[executable] -force-opengl

As described in the previous section, You may also want to disable “vsync” in order for the game not to lock up after launch. If You experience this, instead try:

#!/bin/bash
vblank_mode=0 /path/to/game/[executable] -force-opengl

Note: Obviously, in both cases, replace the path and the [executable] with their appropriate counterparts for the game in question.
Locked