Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/wayland_pointer.c:
return hwnd; }
+static void reapply_cursor_clipping(void) +{ + RECT rect; + UINT context = NtUserSetThreadDpiAwarenessContext(NTUSER_DPI_PER_MONITOR_AWARE); + if (NtUserGetClipCursor(&rect)) NtUserClipCursor(&rect); + NtUserSetThreadDpiAwarenessContext(context); +} + +static void update_cursor_position_hint(HWND hwnd)
I think we can integrate the functionality directly into WAYLAND_ClipCursor instead of having it as a separate function, in order to minimize (re)acquiring the same locks: 1. The warp coordinates can be calculated inside the existing win_data lock region in WAYLAND_ClipCursor. 2. The zwp_locked_pointer_v1_set_cursor_position_hint call can be performed inside the pointer->mutex lock region in WAYLAND_ClipCursor, with a temporary unlock to commit the surface. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7352#note_95732