https://bugs.winehq.org/show_bug.cgi?id=55336
Bug ID: 55336 Summary: Touhou 6 : Full-screen with Alt-tabbing or using DXVK breaks inputs Product: Wine Version: 8.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: riyu12383@gmail.com Distribution: ---
-The Game Here is a very small demo version of the game from archive.org https://archive.org/compress/KoumaTr013/formats=ARCHIVE%20BITTORRENT,METADAT...
To launch this version, you'll need to add Japanese locale like this : LANG=ja_JP.UTF-8 wine 東方紅魔郷.exe
-The bug When launching the game in Full-screen and Alt-Tabbing or using DXVK, the game inputs breaks, its scrolls the menu infinitely or quit the game by itself, the user can't control anything anymore. On the demo version it seems the user only loose the control.
Interestingly on Windows, since Windows 10, the game has an exaggerated speed/framerate in full-screen. Which was fixed using this dx8 to dx9 converter : http://enbdev.com/convertor_dx8_dx9_v0036.htm However this doesn't change anything with wine.
I originally discovered this bug here : https://github.com/AlpyneDreams/d8vk/issues/155
https://bugs.winehq.org/show_bug.cgi?id=55336
YuriK7 riyu12383@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |https://archive.org/compres | |s/KoumaTr013/formats=ARCHIV | |E%20BITTORRENT,METADATA,PNG | |,UNKNOWN Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=55336
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Are you sure this is not a bug with dxvk?
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #2 from YuriK7 riyu12383@gmail.com --- (In reply to Fabian Maurer from comment #1)
Are you sure this is not a bug with dxvk?
To be clearer this either happen immediately if using DXVK, or if using wine alone without DXVK then it happens with alt tabbing. Both only in full-screen. With wine vanilla it is a alt tabbing issue.
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #3 from YuriK7 riyu12383@gmail.com --- Still occurs with wine 8.14
https://bugs.winehq.org/show_bug.cgi?id=55336
YuriK7 riyu12383@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|8.13 |8.15
https://bugs.winehq.org/show_bug.cgi?id=55336
YuriK7 riyu12383@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|8.15 |8.16
https://bugs.winehq.org/show_bug.cgi?id=55336
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |o.dierick@piezo-forte.be Version|8.16 |8.13
--- Comment #4 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- Hello,
Please don't change the reported version. It should reflect the oldest known Wine version affected.
Regards.
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #5 from YuriK7 riyu12383@gmail.com --- Still occurs with current git.
I tried with the wayland driver (using d8vk as waylanddrv only supports vulkan) to see if any difference and got at first :
info: Setting display mode: 640x480@0 info: Setting display mode: 640x480@0 0024:err:system:NtUserChangeDisplaySettings Changing L"\\.\DISPLAY1" display settings returned -2. 0024:err:system:NtUserChangeDisplaySettings Changing L"\\.\DISPLAY1" display settings returned -2. err: D3D9: EnterFullscreenMode: Failed to change display mode err: D3D9: Failed to set initial fullscreen state
The game can't launch, but I tried again with https://gitlab.winehq.org/wine/wine/-/merge_requests/4947 where it do launches but instantly freeze/hang. Interestingly if I launch the game in windowed and then switch to full-screen I get :
wl_surface@36: error 0: buffer scale must be at least one (0 specified) 0140:err:waylanddrv:wayland_read_events_thread Failed to read events from the compositor, terminating process
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #6 from YuriK7 riyu12383@gmail.com --- Still occurs with wine 9.13, also tested as far as wine 2.0.
Turns out the bug also happens in windowed mode, so testing with the wayland driver is possible.
After alt-tabbing, the input are completely unusable, pressing any keyboard key results with this warning : warn:keyboard:WAYLAND_KbdLayerDescriptor Failed to find Xkb layout for HKL 0x4090409
But clicking on the game window with the mouse brings back the keyboard input in a perfectly usable state. That "workaround" doesn't work with the x11 driver.
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #7 from YuriK7 riyu12383@gmail.com --- Pressing escape also works.
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #8 from YuriK7 riyu12383@gmail.com --- Actually, the wayland behavior is a different issue.
The winewayland driver is not directly concerned by the alt tab issue, but it's "alt" contextual menu has some issue.
On Windows, the "alt" contextual menu appears after pressing alt and then enter or up/down arrow button. However pressing alt and then any other button than enter/up/down/left/right button, reactivate the main window.
First issue is that alt tabbing on windows never bring the "alt" contextual menu waiting state, so it seems there's an issue with the handling of the alt button.
Secondly, when the "alt" menu waiting state is reached after pressing alt, pressing w/x keys doesn't reactivate/refocus the main window, while escape and alt does.
So the winex11 driver has an issue with alt-tabbing and the winewayland driver has a slightly buggy "alt" contextual menu.
https://bugs.winehq.org/show_bug.cgi?id=55336
YuriK7 riyu12383@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |winewayland
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #9 from YuriK7 riyu12383@gmail.com --- Created attachment 76865 --> https://bugs.winehq.org/attachment.cgi?id=76865 Fixes the issue on winex11
As for the initial alt tabbing issue, somehow removing that hook call in win32u as in the attached patch fixes the issue. I'm not sure why winewayaland isn't affected, maybe it's because it doesn't need to call NtUserSetForegroundWindow( NtUserGetDesktopWindow() ) in some weird x11 cases when focusing out.
https://bugs.winehq.org/show_bug.cgi?id=55336
YuriK7 riyu12383@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Touhou 6 : Full-screen with |Touhou 6 : Alt-tabbing or |Alt-tabbing or using DXVK |using DXVK breaks inputs |breaks inputs |
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #10 from YuriK7 riyu12383@gmail.com --- In x11 case, when focusing out, that HCBT_ACTIVATE hook call leads to handle_foreground_lost from dinput/dinput_main.c which unacquire the device.
In the case of wayland, when focusing out, dinput receives HCBT_SYSCOMMAND but doesn't handle it.
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #11 from YuriK7 riyu12383@gmail.com --- DXVK case is another issue, removing the hook call from win32u doesn't fix it. It happens immediately when launching/switching to full-screen, so it can't be tested on winewayland yet. Neither handle_foreground_lost or dinput_device_internal_unacquire are called, which are responsible for the x11 (without dxvk) alt-tabbing issue.
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #12 from YuriK7 riyu12383@gmail.com --- Created attachment 76872 --> https://bugs.winehq.org/attachment.cgi?id=76872 DXVK full-screen workaround
The DXVK full-screen issue is caused because when the dinput device is created, somehow the game window is not the foreground window, and then dinput decide to not start the input thread. It doesn't happened with wined3d. This patch is a workaround for that case.
https://bugs.winehq.org/show_bug.cgi?id=55336
YuriK7 riyu12383@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|winewayland |-unknown
https://bugs.winehq.org/show_bug.cgi?id=55336
--- Comment #13 from YuriK7 riyu12383@gmail.com --- Still occurs with latest master containing https://gitlab.winehq.org/wine/wine/-/merge_requests/6569