I messed up in the gmail UI, so resending to the list.
Sorry Dave.
On Thu, Jan 7, 2021 at 3:55 PM Dave MacFarlane <
dri...@gmail.com> wrote:
> My understanding of Wayland's architecture is that it's designed such that windows don't know anything about what's going on outside of them. Warping to an absolute coordinate on the screen shouldn't be possible but warping to a location within your own window shouldn't be a problem.
From my reading, this is mostly correct. Basically, input "flows" one
way from the kernel, into the compositor, then into the program
attached to the focused surface.
There's no (conceptual) problem in the wayland model for a program to
move the pointer around in its own surface, but wayland is implemented
as a pile of extensions onto a protocol that's implemented by a
compositor.
So in order for this to actually work, one would need to design a
protocol to ask the compositor to move the pointer and have enough
compositor authors interested in implementing the extension, which
perhaps explains why this doesn't exist.
For some more context:
The "bad way" to do it I think I found is to use an unstable protocol
(this one:
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml)
to, whenever devdraw is asked to move the pointer, lock the pointer,
warp it, and unlock it.
As far as I can tell from mailing list discussions, this is meant for
games and other things that want to render their own pointer, but have
the compositor's cursor at the correct place when focus changes.
There's also the matter of "how does a remote desktop work?"
It seems like using some RPCs via d-bus to create new input devices
and then ask the compositor to allow access to its surface.
This is clever but not particularly helpful in the case of "I'd like
to move the compositor's pointer."