[tablet-input] Correct compilation failure on dwl 0.7

This problem and fix was initially found and created by @ToYoNiX.
See PR #594
This commit is contained in:
A Frederick Christensen 2025-12-19 13:46:02 -06:00
parent 0870c51872
commit 8e7aeec9c6
No known key found for this signature in database
GPG Key ID: 6183FA655784FC36

View File

@ -1,16 +1,16 @@
From 9221dab35862605bd8768652488f8d6211f15a3e Mon Sep 17 00:00:00 2001 From 6063acfd61538c621a3124f3da38f9b47a56c292 Mon Sep 17 00:00:00 2001
From: Fernando Otto <fernandootto369@gmail.com> From: A Frederick Christensen <dwl@ivories.org>
Date: Tue, 14 Oct 2025 12:52:30 -0300 Date: Fri, 19 Dec 2025 13:34:20 -0600
Subject: [PATCH] Fixing disconnect with the graphics tablet Subject: [PATCH] Correct the tablet-input patch for dwl 0.7
--- ---
Makefile | 6 +- Makefile | 6 +-
config.def.h | 1 + config.def.h | 1 +
dwl.c | 226 +++++++++++++++++++++++++++++++++++++++++++++++++++ dwl.c | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 232 insertions(+), 1 deletion(-) 3 files changed, 231 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile diff --git a/Makefile b/Makefile
index 3358bae..47a2bb2 100644 index ff53040..66c06b2 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -21,7 +21,8 @@ dwl: dwl.o util.o @@ -21,7 +21,8 @@ dwl: dwl.o util.o
@ -46,7 +46,7 @@ index 22d2171..3ad98ef 100644
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int borderpx = 1; /* border pixel of windows */
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index a2711f6..97d3d53 100644 index c717c1d..ed7e056 100644
--- a/dwl.c --- a/dwl.c
+++ b/dwl.c +++ b/dwl.c
@@ -50,6 +50,9 @@ @@ -50,6 +50,9 @@
@ -103,7 +103,7 @@ index a2711f6..97d3d53 100644
static struct wlr_scene_rect *root_bg; static struct wlr_scene_rect *root_bg;
static struct wlr_session_lock_manager_v1 *session_lock_mgr; static struct wlr_session_lock_manager_v1 *session_lock_mgr;
static struct wlr_scene_rect *locked_bg; static struct wlr_scene_rect *locked_bg;
@@ -1133,6 +1152,28 @@ createpopup(struct wl_listener *listener, void *data) @@ -1137,6 +1156,28 @@ createpopup(struct wl_listener *listener, void *data)
LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup); LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
} }
@ -132,14 +132,13 @@ index a2711f6..97d3d53 100644
void void
cursorconstrain(struct wlr_pointer_constraint_v1 *constraint) cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
{ {
@@ -1320,6 +1361,29 @@ destroykeyboardgroup(struct wl_listener *listener, void *data) @@ -1323,6 +1364,28 @@ destroykeyboardgroup(struct wl_listener *listener, void *data)
free(group); free(group);
} }
+void +void
+destroytablet(struct wl_listener *listener, void *data) +destroytablet(struct wl_listener *listener, void *data)
+{ +{
+ wl_list_remove(&tablet_device_destroy.link);
+ wlr_cursor_detach_input_device(cursor, tablet->wlr_device); + wlr_cursor_detach_input_device(cursor, tablet->wlr_device);
+ tablet = NULL; + tablet = NULL;
+} +}
@ -162,7 +161,7 @@ index a2711f6..97d3d53 100644
Monitor * Monitor *
dirtomon(enum wlr_direction dir) dirtomon(enum wlr_direction dir)
{ {
@@ -1539,6 +1603,12 @@ inputdevice(struct wl_listener *listener, void *data) @@ -1542,6 +1605,12 @@ inputdevice(struct wl_listener *listener, void *data)
case WLR_INPUT_DEVICE_POINTER: case WLR_INPUT_DEVICE_POINTER:
createpointer(wlr_pointer_from_input_device(device)); createpointer(wlr_pointer_from_input_device(device));
break; break;
@ -175,7 +174,7 @@ index a2711f6..97d3d53 100644
default: default:
/* TODO handle other input device types */ /* TODO handle other input device types */
break; break;
@@ -2566,6 +2636,8 @@ setup(void) @@ -2569,6 +2638,8 @@ setup(void)
relative_pointer_mgr = wlr_relative_pointer_manager_v1_create(dpy); relative_pointer_mgr = wlr_relative_pointer_manager_v1_create(dpy);
@ -184,7 +183,7 @@ index a2711f6..97d3d53 100644
/* /*
* Creates a cursor, which is a wlroots utility for tracking the cursor * Creates a cursor, which is a wlroots utility for tracking the cursor
* image shown on screen. * image shown on screen.
@@ -2595,6 +2667,10 @@ setup(void) @@ -2598,6 +2669,10 @@ setup(void)
LISTEN_STATIC(&cursor->events.button, buttonpress); LISTEN_STATIC(&cursor->events.button, buttonpress);
LISTEN_STATIC(&cursor->events.axis, axisnotify); LISTEN_STATIC(&cursor->events.axis, axisnotify);
LISTEN_STATIC(&cursor->events.frame, cursorframe); LISTEN_STATIC(&cursor->events.frame, cursorframe);
@ -195,7 +194,7 @@ index a2711f6..97d3d53 100644
cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1); cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
LISTEN_STATIC(&cursor_shape_mgr->events.request_set_shape, setcursorshape); LISTEN_STATIC(&cursor_shape_mgr->events.request_set_shape, setcursorshape);
@@ -2688,6 +2764,156 @@ tagmon(const Arg *arg) @@ -2691,6 +2766,156 @@ tagmon(const Arg *arg)
setmon(sel, dirtomon(arg->i), 0); setmon(sel, dirtomon(arg->i), 0);
} }
@ -353,5 +352,5 @@ index a2711f6..97d3d53 100644
tile(Monitor *m) tile(Monitor *m)
{ {
-- --
2.51.0 2.51.2