]> git.mdlowis.com Git - proto/labwc.git/commitdiff
input: always use mouse emulation for tablet tool mouse
authorJens Peters <jp7677@gmail.com>
Fri, 6 Jun 2025 05:14:21 +0000 (07:14 +0200)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Sat, 7 Jun 2025 20:31:23 +0000 (05:31 +0900)
Using mouse emulation for a tablet tool mouse is just a practical
decision to let such a tool work more smootly, e.g. it avoids weird
menu issues in GTK applications. Since such a tool doesn't have
pen specifix axis like pressure or distance, no functionality is lost.

A solution fully in line with the protocol, which would pass the tool
mouse buttons to the client, would leave us with  e.g. non-working
buttons in current GTK4 since they don't handle the buttons
reported from the tool mouse.
May be this changes in future. But for now, let's just be practical.

src/input/tablet.c

index dbb905d890227b32cfe48f8c2ae686be5384404e..314e5e46de6e896e9bb8f17b622ee30543ee16ae 100644 (file)
@@ -273,8 +273,13 @@ handle_tablet_tool_proximity(struct wl_listener *listener, void *data)
         * enforced. Not having a tool or tablet capable surface will trigger
         * the fallback to cursor move/button emulation in the tablet signal
         * handlers.
+        * Also stick to mouse emulation when the current tool is a tablet mouse.
+        * Client support for tablet mouses in tablet mode is often incomplete
+        * and no functionality is lost since those device do not support tool
+        * specific axis like pressure or distance.
         */
        if (!rc.tablet.force_mouse_emulation
+                       && ev->tool->type != WLR_TABLET_TOOL_TYPE_MOUSE
                        && tablet->seat->server->tablet_manager && !tool) {
                /*
                 * Unfortunately `wlr_tool` is only present in the events, so