backend/libinput: expose libinput_tablet_tool

Exposing libinput_tablet_tool from libinput allows compositors
to set tool specific configuration options like pressure range
and eraser button behavior.

See 'libinput_tablet_tool_*()' functions which require a
'libinput_tablet_tool' handle:
https://wayland.freedesktop.org/libinput/doc/1.30.0/api/group__config.html
(libinput 1.30.0, latest at the time of writing).
This commit is contained in:
Jens Peters 2026-01-19 20:42:42 +01:00
parent b7312b4f95
commit 3eb07b1fdb
2 changed files with 16 additions and 0 deletions

View file

@ -18,6 +18,16 @@ const struct wlr_tablet_impl libinput_tablet_impl = {
.name = "libinput-tablet-tool",
};
struct libinput_tablet_tool *wlr_libinput_get_tablet_tool_handle(
struct wlr_tablet_tool *wlr_tablet_tool) {
struct tablet_tool *tool =
wl_container_of(wlr_tablet_tool, tool, wlr_tool);
assert(tool);
return tool->handle;
}
void init_device_tablet(struct wlr_libinput_input_device *dev) {
const char *name = get_libinput_device_name(dev->handle);
struct wlr_tablet *wlr_tablet = &dev->tablet;