Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_pointer.c:
+ TRACE("Unconfining from hwnd=%p\n", pointer->constraint_hwnd); + zwp_confined_pointer_v1_destroy(pointer->zwp_confined_pointer_v1); + pointer->zwp_confined_pointer_v1 = NULL; + if (constraint == WAYLAND_POINTER_CONSTRAINT_NONE) + pointer->constraint_hwnd = NULL; + } + + if (constraint != WAYLAND_POINTER_CONSTRAINT_MAYBE_LOCK && + pointer->zwp_locked_pointer_v1) + { + TRACE("Unlocking from hwnd=%p\n", pointer->constraint_hwnd); + zwp_locked_pointer_v1_destroy(pointer->zwp_locked_pointer_v1); + pointer->zwp_locked_pointer_v1 = NULL; + if (constraint == WAYLAND_POINTER_CONSTRAINT_NONE) + pointer->constraint_hwnd = NULL; + } Here you'd just have an if/else based on cursor visibility.
Possibly also protocol support but honestly I find that these checks everywhere are just making the code uglier. We should decide on a basic set of required protocols and be done with it, Wayland is about moving things foward isn't it? Compositors should implement the required protocols for Wine to work. I think we're already going to have enough trouble with the *non-existent-but-very-necessary* features to not bother about the *existing-but-maybe-not-implemented* ones. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4593#note_55218