Question about wl_pointer_set_cursor and hotspots

Pekka Paalanen ppaalanen at gmail.com
Wed Jan 13 10:52:07 UTC 2021


On Wed, 6 Jan 2021 12:45:22 -0800
Waris Boonyasiriwat <waris.boonyasiriwat at gmail.com> wrote:

> Hi Simon,
> 
> I grabbed one just now - the debug trace is attached in this e-mail. For
> context, I ran an app that kept changing the cursor shape from arrow to
> I-beam, to pointer, etc, back and forth.

Hi,

I hacked weston-clickdot to use a cursor image with hotspot on the
bottom edge, and it works fine. The one difference I see compared to
your trace is that weston demos first commit the surface and then set
it as the pointer cursor.

I also hacked the clickdot demo to set the pointer role before
committing the surface, like in your trace, and it still works.

If you do this change in clickdot:

--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -240,7 +240,8 @@ motion_handler(struct widget *widget,
        cursor_timeout_reset(clickdot);
        clickdot->cursor_timeout_input = input;
 
-       return CURSOR_BLANK;
+       return CURSOR_BOTTOM;
 }

does the hotspot move correctly to the middle bottom of the cursor
image? You can tell by looking at where the line gets drawn (it's a
simple drawing app).

If clickdot works ok, but your GLFW app does not, then there is still
some difference in the protocol sequence.

If clickdot has wrong hotspot, then it's something else. What backend
did you try Weston with? If DRM, how about X11 or Wayland backends?

If both weston/DRM and Mutter have broken hotspot, but weston/X11 or
weston/wayland have correct hotspot for all apps, then we might have to
look at the KMS driver.

Are you using a virtual machine for testing, btw.?


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20210113/ee28fa64/attachment.sig>


More information about the wayland-devel mailing list