input: add comments about tablet mouse emulation

This commit is contained in:
Jens Peters 2024-10-20 18:58:07 +02:00 committed by Johan Malm
parent c6a6be8219
commit e67fda50cf

View file

@ -131,6 +131,12 @@ tablet_get_coords(struct drawing_tablet *tablet, double *x, double *y, double *d
adjust_for_rotation_relative(rc.tablet.rotation, dx, dy); adjust_for_rotation_relative(rc.tablet.rotation, dx, dy);
adjust_for_motion_sensitivity(rc.tablet_tool.relative_motion_sensitivity, dx, dy); adjust_for_motion_sensitivity(rc.tablet_tool.relative_motion_sensitivity, dx, dy);
/*
* Do not return a surface when mouse emulation is enforced. Not
* having a surface or tablet tool (see handle_tablet_tool_proximity())
* will trigger the fallback to cursor move/button emulation in the
* tablet signal handlers.
*/
if (rc.tablet.force_mouse_emulation if (rc.tablet.force_mouse_emulation
|| !tablet->tablet_v2) { || !tablet->tablet_v2) {
return NULL; return NULL;
@ -264,6 +270,12 @@ handle_tablet_tool_proximity(struct wl_listener *listener, void *data)
double x, y, dx, dy; double x, y, dx, dy;
struct wlr_surface *surface = tablet_get_coords(tablet, &x, &y, &dx, &dy); struct wlr_surface *surface = tablet_get_coords(tablet, &x, &y, &dx, &dy);
/*
* Do not attempt to create a tablet tool when mouse emulation is
* enforced. Not having a tool or tablet capable surface will trigger
* the fallback to cursor move/button emulation in the tablet signal
* handlers.
*/
if (!rc.tablet.force_mouse_emulation if (!rc.tablet.force_mouse_emulation
&& tablet->seat->server->tablet_manager && !tool) { && tablet->seat->server->tablet_manager && !tool) {
/* /*