Cursor updates during drag and drop
As agreed upon at https://gitlab.freedesktop.org/wayland/wayland-protocols/-/wikis/meetings#2023-08-16-toplevel_drag, the compositor should send a wl_pointer.leave
event to the source client, and wl_data_device.enter
to the destination client.
However, this introduces issues with cursor updates. Many clients want to update the cursor during drag and drop. If the compositor sends a wl_pointer.leave
event, wl_pointer.set_cursor
requests will be ignored.
How much this issue is noticeable depends on the compositor. For example, kwin is going to reset the cursor image after sending wl_pointer.leave
event, so the cursor is going to have the default cursor shape. Compositors that based their data device implementation on weston's one are less likely to be affected because
- they don't reset the cursor image after sending
wl_pointer.leave
- and many clients set the same cursor surface but keep attaching new buffers instead, so it's possible to update the cursor even after sending
wl_pointer.leave
With the cursor-shape-v1
protocol, updating the cursor surface in such fashion will not be possible.
The data device interface needs either some clarifications or new requests to help with cursor updates. Whether the compositor can guess the right cursor shape is not clear because the visuals depend on what is being dragged, for example it can be a closed hand or pointing arrow (to indicate an insertion point, etc).