Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8
-
None
Description
Qt updates the cursor in two steps:
- set hotspot
- attach a buffer
This can result in the cursor unexpectedly jumping if the compositor updates the cursor between set hotspot and attach a buffer steps, e.g. https://bugs.kde.org/show_bug.cgi?id=488398. In order to ensure that cursor updates are atomic and there are no glitches, QtWayland needs to update the cursor differently:
- if the cursor needs to be updated after receiving an enter event, a new buffer should be attached to the surface before the wl_pointer.set_cursor() request
wl_surface.offset(surface, 0, 0) wl_surface.attach(surface, buffer, 0, 0) wl_surface.commit(surface) wl_pointer.set_cursor(pointer, surface, hot_x, hot_y)
- if the cursor needs to be updated after wl_pointer.set_cursor(), wl_surface.offset should be used
wl_surface.offset(surface, old_hot_x - new_hot_x, old_hot_y - new_hot_y) wl_surface.attach(surface) wl_surface.commit(surface)
Note that wl_surface.offset doesn't take an absolute hotspot position, instead it takes an offset relative to the old hotspot position. wl_pointer.set_cursor takes an absolute hotspot position.