[PATCH xwayland] xwayland: Always update the wl_pointer cursor on pointer focus

Olivier Fourdan ofourdan at redhat.com
Mon Sep 21 07:06:58 PDT 2015


On 21/09/15 11:19, Daniel Stone wrote:
> Hi,
>
> On 21 September 2015 at 09:52, Jonas Ådahl <jadahl at gmail.com> wrote:
>> In Wayland, a client (in this case XWayland) should set the cursor
>> surface when it receives pointer focus. Not doing this will leave the
>> curser at whatever it was previously.
>>
>> When running on XWayland, the X server will not be the entity that controls
>> what actual pointer cursor is displayed, and it wont be notified about the
>> pointer cursor changes done by the Wayland compositor. This causes X11 clients
>> running via XWayland to end up with incorrect pointer cursors because the X
>> server believes that, if the cursor was previously set to the cursor C, if we
>> receive Wayland pointer focus over window W which also has the pointer cursor
>> C, we do not need to update it. This will cause us to end up with the wrong
>> cursor if cursor C was not the same one that was already set by the Wayland
>> compositor.
>>
>> This patch introduces new API to make it possible for a XWayland to trigger
>> resetting of the pointer cursor sprite through the various layers that
>> deals with that. The new function that does this is InvalidateCursor().
>>
>> XWayland will now call this function upon receiving pointer focus,
>> making sure that subsequent calls will trigger resetting of the pointer
>> cursor sprite.
>>
>> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
>
> Reviewed-by: Daniel Stone <daniels at collabora.com>

I picked this patch up in my tree for xwayland:

http://cgit.freedesktop.org/~ofourdan/xserver/log/?h=xwayland

but I had to amend it as it conflicts with a previous patch from Peter:

http://patchwork.freedesktop.org/patch/58201/

(basically I changed MASTER_POINTER to POINTER_OR_FLOAT in your patch to 
avoid reverting the fix from Peter).

I also reproduced the issue and tested the fix, lgtm.

Cheers,
Olivier



More information about the xorg-devel mailing list