How to get absolute mouse cursor position in wayland

Viewed 193

How does one go about finding the absolute mouse cursor position in wayland (Not X11). For example in windows we use the GetCursorPos() function from windows.h and that will give absolute X,Y positions starting from 0,0.

I'm aware of /dev/input/mice however that is relative and not absolute. The closest thing I came across was setting them, but not getting them.

1 Answers

In Wayland, you need to implement this for each compositor separately (if the compositor implements it at all). The Wayland protocol itself does not provide such feature.

There are also external tools/libraries that should be able to expose such functionality: Wayland Global Pointer Location

Related