[Bug 57585] New: Make UseTakeFocus default to N on Linux, so games can accept input when refocused
https://bugs.winehq.org/show_bug.cgi?id=57585 Bug ID: 57585 Summary: Make UseTakeFocus default to N on Linux, so games can accept input when refocused Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs(a)winehq.org Reporter: joeytwiddle(a)gmail.com Distribution: --- To reproduce the problem: 1. On Linux (e.g. KDE5 with X11), start a game or fullscreen app (e.g. Among Us or Bad North Jotunn Edition, but you can find many games with the same problem) 2. Once the game has opened and is fullscreen, use Alt-Tab to switch to another app 3. Now switch back to the game. 4. The game now ignores mouse and keyboard input! To fix it, kill the game, then run: wine reg add 'HKEY_CURRENT_USER\Software\Wine\X11 Driver' /t REG_SZ /v UseTakeFocus /d N /f Now try the above steps again. It has likely fixed the problem! Because the problem is so common, please consider making the above fix the default setting on Linux. Hopefully it will benefit more users than it inconveniences. --- The problem and solution have been mentioned here: - https://askubuntu.com/questions/299286/how-to-recover-focus-after-losing-it-... - https://bugs.winehq.org/show_bug.cgi?id=47929 - https://bugs.winehq.org/show_bug.cgi?id=48121 - https://bugs.winehq.org/show_bug.cgi?id=37393 - https://bugs.winehq.org/show_bug.cgi?id=56073 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=57585 Piotr Respondek <piotr.respondek@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.respondek@gmail.com --- Comment #1 from Piotr Respondek <piotr.respondek@gmail.com> --- Created attachment 80394 --> http://bugs.winehq.org/attachment.cgi?id=80394 Patch: default UseTakeFocus to FALSE When UseTakeFocus is TRUE (current default), Wine defers window activation to the WM_TAKE_FOCUS protocol. This creates a race condition between Wine and the window manager that causes games and other fullscreen applications to lose input focus after alt-tabbing back, requiring a restart to regain control. Tested with: - BioShock Remastered (via Heroic/Proton, fullscreen) - DOOM 64 (via Heroic/Proton, fullscreen) Both games reliably lost input focus after alt-tab with UseTakeFocus=TRUE. After setting UseTakeFocus to FALSE (either via registry or this patch), focus is correctly restored every time via X11DRV_FocusIn(). The patch changes the default value of use_take_focus from TRUE to FALSE in dlls/winex11.drv/x11drv_main.c. Users who need the old behavior can still enable it via the registry key HKCU\Software\Wine\X11 Driver\UseTakeFocus. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=57585 Rémi Bernon <rbernon@codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com --- Comment #2 from Rémi Bernon <rbernon@codeweavers.com> --- Things have changed a lot in Wine focus / active window support and it should be much improved now, and UseTakeFocus = Y should work better than the other way around. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=57585 --- Comment #3 from Piotr Respondek <piotr.respondek@gmail.com> --- Tested with Wine 11.2 (Staging) on Linux Mint 22.2 / KDE / X11 with BioShock Remastered (via Heroic/Proton, fullscreen). You were right — the focus issue no longer reproduces with UseTakeFocus=Y on Wine 11.2. Alt-tabbing out and back correctly restores input focus every time. Previously tested on GE-Proton-latest where the issue was present. The recent focus/active window improvements clearly resolved it. Withdrawing the patch. Thank you for the quick response. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=57585 Zeb Figura <z.figura12@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Make UseTakeFocus default |Many games focus poorly |to N on Linux, so games can |when alt-tabbing back into |accept input when refocused |them, without | |UseTakeFocus=N Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #4 from Zeb Figura <z.figura12@gmail.com> --- Closing then. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=57585 Alexandre Julliard <julliard@winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Alexandre Julliard <julliard@winehq.org> --- Closing bugs fixed in 11.3. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
WineHQ Bugzilla -
WineHQ Bugzilla