Drawing your own pointer in Wayland

Philipp Kerling <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
Hi all,

in a recent discussion on Bugzilla about an application (Kodi) that
draws its own cursor on Wayland, Martin Flöser mentioned that Wayland
clients that do so should always use the unstable pointer-constraints
and relative-pointer protocols and that drawing the cursor without
using these is unsupported as far as KWin is concerned.
I'd like some further input on this, but as I feel the KWin bug tracker
is not the appropriate place to ask such questions, I'm posting to this
mailing list.

Currently, Kodi hides the compositor cursor and draws its own cursor as
part of its main surface at whatever position the last wl_pointer event
indicated. The reason is that the cursor appearance is part of the
internal skinning engine and cannot easily be put on a separate surface
(for wl_pointer.set_cursor) at the moment without heavy refactoring. I
know that it increases lag and is not a perfect solution, but it will
stay that way for the time being. Also, I can imagine that some other
clients ported from other OSes (e.g. games) may use a similar approach.

So what I guess I'm missing is a concrete example of what sort of
erratic behavior I can expect with the current setup (that does not use
pointer constraining and relative motion) and how the two protocols
improve that situation. In practice I did not notice any wrong/strange
behavior yet, but I know that this does not mean much. Martin Flöser
mentioned pointer warping as an issue, but to be honest I did not
completely understand under which circumstances this would become
problematic.

I'm hoping someone can shed a bit more light on this.

Thanks and regards,
Philipp (Kodi dev)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.