How to get position of tablet pen relative to surfaces?

ferreiradaselva ferreiradaselva at protonmail.com
Sat May 12 22:04:26 UTC 2018


I made a libinput context that I use to get the coordinates of the (wacom)
tablet pen with `libinput_event_tablet_tool_get_x()` and
`libinput_event_tablet_tool_get_y()`.

Since libinput knows nothing of surfaces, the value is obviously the global
position of the pen. If I had the global position of the surface, I could
subtract the position of the pen relative to the surface, but according with the
docs:

"...Clients don't know the global position of their surfaces..."

> https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Surface

Is there any way to solve this problem? I'm currently using `wl_surface` with
`xdg_surface` and `xdg_toplevel` roles.

Thanks in advance,

- Felipe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180512/cf4114f7/attachment.html>


More information about the wayland-devel mailing list