Improve cursor locking and confining
Closed, ResolvedPublic

Description

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: D13439

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): D13492 - does not yet unconstrain on Alt+Tab because in this case the client is not deactivated, for that: D13758 or D14142
  • 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. Patch: D15234

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. Also was fixed with: D13466
romangg updated the task description. (Show Details)May 31 2018, 3:21 PM
romangg updated the task description. (Show Details)Jun 10 2018, 3:56 PM
romangg updated the task description. (Show Details)Jul 16 2018, 8:49 AM
romangg closed this task as Resolved.