https://bugs.winehq.org/show_bug.cgi?id=48772
Bug ID: 48772 Summary: Attack on Titan 2 continually clips the cursor, resulting in incorrect cursor events Product: Wine Version: 5.4 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@winehq.org Reporter: qsniyg@mail.com Distribution: ---
For example:
... 0009:trace:cursor:SetCursor 0x20046 0009:trace:cursor:ClipCursor Clipping to (-3,-12)-(1923,1093) 0009:trace:cursor:ungrab_clipping_window no longer clipping 0009:trace:cursor:ClipCursor Clipping to (-3,-12)-(1923,1093) 0009:trace:cursor:ungrab_clipping_window no longer clipping 0009:trace:cursor:ClipCursor Clipping to (-3,-12)-(1923,1093) 0009:trace:cursor:ungrab_clipping_window no longer clipping ... 0009:trace:cursor:SetCursor 0x20046 0009:trace:cursor:X11DRV_MotionNotify hwnd 0x10052/4400003 pos 963,543 is_hint 0 serial 6080 0009:trace:cursor:ClipCursor Clipping to (-3,-12)-(1923,1093) 0009:trace:cursor:ungrab_clipping_window no longer clipping 0009:trace:cursor:X11DRV_MotionNotify hwnd 0x10052/4400003 pos 924,521 is_hint 0 serial 6083 00ce:trace:cursor:X11DRV_SetCursorPos warped to 960,540 serial 6413 001f:trace:cursor:X11DRV_EnterNotify hwnd 0x10020/3a0000a pos 921,509 detail 2 0009:trace:cursor:ClipCursor Clipping to (-3,-12)-(1923,1093) 0009:trace:cursor:ungrab_clipping_window no longer clipping 0009:trace:cursor:ClipCursor Clipping to (-3,-12)-(1923,1093) 0009:trace:cursor:ungrab_clipping_window no longer clipping ...
Since the cursor is continually warped to the center of the screen, when ungrab_clipping_window calls XUnmapWindow, it reports to the game that the cursor has moved back to the center, resulting in the common "camera refuses to move" bug.
Although the documentation[1] states that XUnmapWindow does nothing if called on a window that's already unmapped, when adding a variable to keep track of whether it's mapped or not and only unmapping it when needed, the issue is fixed.
[1] https://tronche.com/gui/x/xlib/window/XUnmapWindow.html
https://bugs.winehq.org/show_bug.cgi?id=48772
GloriousEggroll@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |GloriousEggroll@gmail.com
--- Comment #1 from GloriousEggroll@gmail.com --- testing this patch - it conflicts with https://bugs.winehq.org/show_bug.cgi?id=48946 which was fixed in staging. It also causes a weird bug where if an application crashes or doesn't close properly, a "phantom" invisible layer happens on the screen where you can't see the mouse cursor on the monitor the application was running on until you kill wine.