From 096b8a38deec76d007b67499e408ea245221e0f8 Mon Sep 17 00:00:00 2001 From: Sqooky Date: Tue, 20 Jan 2026 16:52:07 -0500 Subject: [PATCH] Makes the compositor not crash whenever you close the tablet driver. This is a duplicate of https://github.com/DreamMaoMao/mangowc/commit/92ed929a3c38cc10b453017520592e8f2e500cfa --- src/ext-protocol/tablet.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ext-protocol/tablet.h b/src/ext-protocol/tablet.h index 79580818..30b6baf2 100644 --- a/src/ext-protocol/tablet.h +++ b/src/ext-protocol/tablet.h @@ -55,8 +55,16 @@ void createtablet(struct wlr_input_device *device) { } } -void destroytablet(struct wl_listener *listener, void *data) { tablet = NULL; } +void destroytablet(struct wl_listener *listener, void *data) { + + wl_list_remove(&listener->link); + + + tablet = NULL; + + +} void destroytabletsurfacenotify(struct wl_listener *listener, void *data) { if (tablet_curr_surface) wl_list_remove(&destroy_tablet_surface_listener.link); @@ -69,10 +77,10 @@ void destroytablettool(struct wl_listener *listener, void *data) { } void tabletapplymap(double tablet_width, double tablet_height, - struct wlr_fbox box, double *x, double *y) + struct wlr_fbox box, double *x, double *y) { - if ((!box.x && !box.y && !box.width && !box.height) - || !tablet_width || !tablet_height) { + if ((!box.x && !box.y && !box.width && !box.height) || !tablet_width || + !tablet_height) { return; }