]> git.mdlowis.com Git - proto/labwc.git/commitdiff
input: add comments about tablet mouse emulation
authorJens Peters <jp7677@gmail.com>
Sun, 20 Oct 2024 16:58:07 +0000 (18:58 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 20 Oct 2024 20:51:02 +0000 (21:51 +0100)
src/input/tablet.c

index 9a72e6e5df7a278fcc58aeb654ff93449d790830..02783888fc77748954d1e4b8c91b848ec51802c6 100644 (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_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
                        || !tablet->tablet_v2) {
                return NULL;
@@ -264,6 +270,12 @@ handle_tablet_tool_proximity(struct wl_listener *listener, void *data)
        double 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
                        && tablet->seat->server->tablet_manager && !tool) {
                /*