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

Jonas Ådahl jadahl at gmail.com
Mon Sep 21 18:11:01 PDT 2015


On Mon, Sep 21, 2015 at 10:28:14PM +0100, Keith Packard wrote:
> Jonas Ådahl <jadahl at gmail.com> writes:
> 
> > 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.
> 
> It seems like it would be far simpler to just remember the last cursor
> set down in the xwayland bits and set the cursor back to that on
> enter. If the actual cursor needs to change to something else, it'll get
> set immediately afterwards.

The reason I didn't do this was that we'd send duplicate set_cursor
requests when the cursor actually did change. What the patch does is
make it so that the path that actually does change the cursor when it
changes according to the X server always does it when needed in
Xwayland. I assume we still need to call CheckMotion() on enter to
actually keep the state up to date anyway.

> 
> Alternatively, just hacking ChangeToCursor to have a way to skip the
> check for identical cursors would be a pretty simple way to make sure
> your driver always saw DisplayCursor calls for every cursor change, and
> you could do whatever optimizations you wanted in there.

This is what this patch does by introducing the "invalidated" state
causing ChangeToCursor to ignore that the cursor didn't change.
mipoiner.c has its own didn't-change-checking which is why there is the
same type of code added there. Or do you have a suggestion on how to do
that without adding API (in both events.c and mipointer.c)?


Jonas

> 
> -- 
> -keith




More information about the xorg-devel mailing list