VMware & Wayland [WAS Re: Blender3D & cursor clamping]

Kristian Høgsberg krh at bitplanet.net
Mon Dec 13 12:41:45 PST 2010


2010/12/9 Thomas Hellstrom <thellstrom at vmware.com>:
> Kristian, Others,
>
> On 12/09/2010 08:36 PM, Kristian Høgsberg wrote:
>>
>>> I'm interested in how Wayland deals with input&  about mouse coordinates.
>>>
>>> Currently Blender can fake off screen mouse coordinates on X11 by
>>> hiding the cursor warping the position.
>>> However it would be a lot nicer if the Wayland functions were able to
>>> do this. (I heard this is possible on the OSX).
>>>
>>> Are there any docs on how to grab the mouse cursor, warp the cursor
>>> and is there anything like raw events which can be used for low level
>>> interface functions?
>>>
>>
>> There are no docs, but we've discussed similar requirements before:
>>
>>
>> http://lists.freedesktop.org/archives/wayland-devel/2010-November/000117.html
>>
>> The idea is what I call "application pointer" in that email.  The idea
>> is that the compositor hides the cursor and just sends relative motion
>> events.  The application is then responsible for updating cursor
>> position, including pointer acceleration etc, or just not draw a
>> cursor but spin a cube, rotate the viewport or control a game.  Now
>> one thing I'd like to do different from X is that this mode isn't
>> going to be an open ended grab.  The compositor is going to be in
>> control and will be able to override it and switch to different
>> applications.  I'm thinking that this input mode is only available
>> when the application is fullscreen or optionally while a mouse button
>> is pressed.  Maybe also while the application has keyboard focus.
>>
>> Kristian
>>
>
> At VMware, we've started investigating what it would take to support
> Wayland, both on the host side (workstation / player) and on the guest side.
>
> For the guest side, it doesn't seem to be too much work except we'd at some
> point need full GL, and we perhaps need to find a way to optimize
> pageflipping when we can't do it on real hardware.
>
> The tricky thing is the host side. I have a fairly elaborate list of
> features, in particular including cursor warping and open-ended grabs that
> we, according to the input people, can't work around and that are used on
> all hosted systems, like Window, Mac and X11.
>
> So my question is basically, is there a chance for some flexibility here for
> very demanding applications?

Hi Thomas,

We've talked about cursor grabs and warping before on the list as
something games also want to do.  It turns out that typically what
they really want is to draw their own cursor or no cursor at all, keep
the cursor inside the window and receive relative events.  As far as I
know, when the vmware host is running under linux, it runs in much the
same mode.  Grabbing the cursor and continuously warping it into the
window center is just how that is implemented.

I'd like to support most of what application do under X, but maybe not
exactly the way it works under X.  For the grab and warp case, I want
to restrict this behaviour to when the application is active (has
keyboard focus).  The compositor can always switch to a different
application or the user can alt-tab (or whichever key the compositor
uses) away from the application.  The way it will work is that the
compositor stops moving the mouse cursor automatically, sends relative
mouse events to the application, and the application can then maintain
the cursor speed and position and place the cursor relative to its
surface, or just hide it.

This should work well for games, for nested Wayland or X servers or
similar fullscreen experiences like the vmware host, qemu, vnc etc.
Will that work for the case where you're currently using grabs and
cursor warping?

Kristian


More information about the wayland-devel mailing list