mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-06-11 10:23:19 +00:00
fix: enable focus-follow-mouse for tablet pen input
This commit is contained in:
committed by
A Frederick Christensen
parent
ea5c2c7439
commit
2bfdd50f98
@@ -1,7 +1,7 @@
|
||||
From a14dff19f38fffa498f3de4679952b39b4323502 Mon Sep 17 00:00:00 2001
|
||||
From 3a142ab58c5a66d2d71a8184b7e318d0f9d048c6 Mon Sep 17 00:00:00 2001
|
||||
From: pi66 <pixel2176@proton.me>
|
||||
Date: Wed, 8 Apr 2026 21:47:41 +0100
|
||||
Subject: [PATCH] feat: add pad/tool bindings and pen region
|
||||
Date: Mon, 27 Apr 2026 21:13:38 +0100
|
||||
Subject: [PATCH] fix: enable focus-follow-mouse for tablet pen input
|
||||
|
||||
---
|
||||
Makefile | 6 +-
|
||||
@@ -34,7 +34,7 @@ index 578194f..e0d1835 100644
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 8a6eda0..288494e 100644
|
||||
index 8a6eda0..9c678d4 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -4,6 +4,7 @@
|
||||
@@ -75,7 +75,7 @@ index 8a6eda0..288494e 100644
|
||||
+ { 0, 0, NULL, {0} }
|
||||
+};
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 44f3ad9..7572756 100644
|
||||
index 44f3ad9..a5ae8e7 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -51,6 +51,9 @@
|
||||
@@ -132,7 +132,7 @@ index 44f3ad9..7572756 100644
|
||||
static void startdrag(struct wl_listener *listener, void *data);
|
||||
static void tag(const Arg *arg);
|
||||
static void tagmon(const Arg *arg);
|
||||
+static void tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y, double x, double y, double dx, double dy);
|
||||
+static void tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y, double x, double y, double dx, double dy, uint32_t time);
|
||||
+static void tablettoolproximity(struct wl_listener *listener, void *data);
|
||||
+static void tabletpadbutton(struct wl_listener *listener, void *data);
|
||||
+static void tablettoolaxis(struct wl_listener *listener, void *data);
|
||||
@@ -326,7 +326,7 @@ index 44f3ad9..7572756 100644
|
||||
+
|
||||
+void
|
||||
+tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x, bool change_y,
|
||||
+ double x, double y, double dx, double dy)
|
||||
+ double x, double y, double dx, double dy, uint32_t time)
|
||||
+{
|
||||
+ struct wlr_surface *surface = NULL;
|
||||
+ double sx, sy;
|
||||
@@ -351,7 +351,7 @@ index 44f3ad9..7572756 100644
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ motionnotify(0, NULL, 0, 0, 0, 0);
|
||||
+ motionnotify(time, NULL, 0, 0, 0, 0);
|
||||
+
|
||||
+ xytonode(cursor->x, cursor->y, &surface, NULL, NULL, &sx, &sy);
|
||||
+ if (surface && !wlr_surface_accepts_tablet_v2(surface, tablet))
|
||||
@@ -398,7 +398,7 @@ index 44f3ad9..7572756 100644
|
||||
+ destroytabletsurfacenotify(NULL, NULL);
|
||||
+ break;
|
||||
+ case WLR_TABLET_TOOL_PROXIMITY_IN:
|
||||
+ tablettoolmotion(tablet_tool, true, true, event->x, event->y, 0, 0);
|
||||
+ tablettoolmotion(tablet_tool, true, true, event->x, event->y, 0, 0, event->time_msec);
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
@@ -414,7 +414,7 @@ index 44f3ad9..7572756 100644
|
||||
+ tablettoolmotion(tablet_tool,
|
||||
+ event->updated_axes & WLR_TABLET_TOOL_AXIS_X,
|
||||
+ event->updated_axes & WLR_TABLET_TOOL_AXIS_Y,
|
||||
+ event->x, event->y, event->dx, event->dy);
|
||||
+ event->x, event->y, event->dx, event->dy, event->time_msec);
|
||||
+
|
||||
+ if (event->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE)
|
||||
+ wlr_tablet_v2_tablet_tool_notify_pressure(tablet_tool, event->pressure);
|
||||
|
||||
Reference in New Issue
Block a user