wayland: avoid set_cursor() when unchanged or invisible
- pointer enters a surface
- tablet tool comes in proximity and enters the same surface
- gdk sets tablet tool cursor
- sway sees the new tablet cursor, hides the mouse cursor, leading to a leave event on its surface
- gdk handles the leave, rescales the mouse cursor to some default, and sets the mouse cursor again
- sway sees the new mouse cursor, hides the tablet cursor, leading to a leave event on its surface
- gdk handles the leave, rescales the tablet cursor to some default, and sets the tablet cursor again
- goto 3
Note that sway only shows one cursor, but both a pointer and tablet device are present on the seat. In a brief test, I thought I had also observed the issue when the two input devices were on different seats. Maybe sway adds a
wl_pointer device to a seat with the tablet and no mouse? But that shouldn't receive events when the client handles tablet input, right? So maybe there's also something not quite ideal on the sway side. I'm going to capture a log in the situation with two seats, let's see what that reveals. I might also be missing something completely different here.
In any case, this MR at least improves the situation and should be beneficial on its own; see the commit message. Please review carefully, I'm new to both the sway as well as the GDK code, so what I claim here could be imprecise.