Cursor locking and confining is not yet working very well at the moment. It needs to be improved because many Xwayland apps, in particular games need it to work properly in a Wayland session.
First step was to create a **test application** to better observe the current behavior: 1. Wayland native test: D13238. 2. Add Xwayland testing backend: //to be done//
**Large functional changes I recommend:**
* Unconditionally unconstrain cursor whenever the constraining surface loses keyboard focus (for example on Alt+Tab or when a launcher is open)
* Remove the KWin-internal constrain warning messages as soon as the above works correctly. They show too often and don't work as intended with Xwayland (for example grabbing Xwayland windows to move shows them). It is also a quite common work flow to reclaim control of the mouse/keyboard by opening menus or switching applications.
**Small functional improvements:**
* Add cursor hinting in KWayland and KWin: T4692 T4693
**Bugs to fix:**
* Xwayland apps do not correctly unlock/unconfine on exit: https://bugs.kde.org/show_bug.cgi?id=388885 //Fix:// D13466
* Same holds for in app switching of Xwayland clients from pointer grab, i.e. lock, to no grab, i.e. unlock, (example: playing Neverball and going back to menu). Might be related to above. //EDIT: It is. D13466 fixes it as well.//
* On Xwayland master mouse movement is not translated at all right now in the games I tested (Xwayland bug?). //Fix:// D13257
* Test app shows that a persistent Wayland native lock is not properly unlocked on releasing the pointer lock object.