touch-input: update for wlroots-next-4fd683c

This commit is contained in:
pi66
2026-09-29 11:50:56 +01:00
parent e142fc1e5e
commit d69efde56f
@@ -1,14 +1,14 @@
From 22342273e7dfb9af1e7e4b19b9b64ccc05a70023 Mon Sep 17 00:00:00 2001
From 5501a1138fb1be89fd3fb21e3d8ac8cfbc6ff38e Mon Sep 17 00:00:00 2001
From: pi66 <pixel2176@proton.me>
Date: Fri, 25 Sep 2026 19:59:48 +0100
Subject: [PATCH] fix: add missing touches list declaration
Date: Tue, 29 Sep 2026 11:46:55 +0100
Subject: [PATCH] touch-input: update for wlroots-next-4fd683c
---
dwl.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 158 insertions(+)
diff --git a/dwl.c b/dwl.c
index 4cfd0fd..e6d8433 100644
index 26fb3a0..3c60d4d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -58,6 +58,7 @@
@@ -32,7 +32,7 @@ index 4cfd0fd..e6d8433 100644
typedef struct {
/* Must keep this field first */
unsigned int type; /* LayerShell */
@@ -289,7 +296,9 @@ static void createnotify(struct wl_listener *listener, void *data);
@@ -291,7 +298,9 @@ static void createnotify(struct wl_listener *listener, void *data);
static void createpointer(struct wlr_pointer *pointer);
static void createpointerconstraint(struct wl_listener *listener, void *data);
static void createpopup(struct wl_listener *listener, void *data);
@@ -42,7 +42,7 @@ index 4cfd0fd..e6d8433 100644
static void cursorframe(struct wl_listener *listener, void *data);
static void cursorwarptohint(void);
static void destroydecoration(struct wl_listener *listener, void *data);
@@ -359,6 +368,10 @@ static void togglefloating(const Arg *arg);
@@ -361,6 +370,10 @@ static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
@@ -53,7 +53,7 @@ index 4cfd0fd..e6d8433 100644
static void unlocksession(struct wl_listener *listener, void *data);
static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
static void unmapnotify(struct wl_listener *listener, void *data);
@@ -429,6 +442,7 @@ static struct wlr_output_layout *output_layout;
@@ -430,6 +443,7 @@ static struct wlr_output_layout *output_layout;
static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
@@ -61,7 +61,7 @@ index 4cfd0fd..e6d8433 100644
static int consumed[KEY_MAX + 1];
/* global event handlers */
@@ -459,6 +473,10 @@ static struct wl_listener request_set_sel = {.notify = setsel};
@@ -460,6 +474,10 @@ static struct wl_listener request_set_sel = {.notify = setsel};
static struct wl_listener request_set_cursor_shape = {.notify = setcursorshape};
static struct wl_listener request_start_drag = {.notify = requeststartdrag};
static struct wl_listener start_drag = {.notify = startdrag};
@@ -72,7 +72,7 @@ index 4cfd0fd..e6d8433 100644
static struct wl_listener new_session_lock = {.notify = locksession};
static struct wl_listener new_foreign_toplevel_capture_request = {.notify = capturerequest};
@@ -874,6 +892,10 @@ cleanuplisteners(void)
@@ -873,6 +891,10 @@ cleanuplisteners(void)
wl_list_remove(&request_set_cursor_shape.link);
wl_list_remove(&request_start_drag.link);
wl_list_remove(&start_drag.link);
@@ -83,7 +83,7 @@ index 4cfd0fd..e6d8433 100644
wl_list_remove(&new_session_lock.link);
wl_list_remove(&new_foreign_toplevel_capture_request.link);
#ifdef XWAYLAND
@@ -1297,6 +1319,16 @@ createpopup(struct wl_listener *listener, void *data)
@@ -1306,6 +1328,16 @@ createpopup(struct wl_listener *listener, void *data)
LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
}
@@ -100,7 +100,7 @@ index 4cfd0fd..e6d8433 100644
void
cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
{
@@ -1703,6 +1735,9 @@ inputdevice(struct wl_listener *listener, void *data)
@@ -1711,6 +1743,9 @@ inputdevice(struct wl_listener *listener, void *data)
case WLR_INPUT_DEVICE_POINTER:
createpointer(wlr_pointer_from_input_device(device));
break;
@@ -110,7 +110,7 @@ index 4cfd0fd..e6d8433 100644
default:
/* TODO handle other input device types */
break;
@@ -1715,6 +1750,8 @@ inputdevice(struct wl_listener *listener, void *data)
@@ -1723,6 +1758,8 @@ inputdevice(struct wl_listener *listener, void *data)
caps = WL_SEAT_CAPABILITY_POINTER;
if (!wl_list_empty(&kb_group->wlr_group->devices))
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
@@ -119,7 +119,7 @@ index 4cfd0fd..e6d8433 100644
wlr_seat_set_capabilities(seat, caps);
}
@@ -2781,6 +2818,13 @@ setup(void)
@@ -2799,6 +2836,13 @@ setup(void)
wl_signal_add(&cursor->events.axis, &cursor_axis);
wl_signal_add(&cursor->events.frame, &cursor_frame);
@@ -133,7 +133,7 @@ index 4cfd0fd..e6d8433 100644
cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
wl_signal_add(&cursor_shape_mgr->events.request_set_shape, &request_set_cursor_shape);
@@ -2957,6 +3001,120 @@ toggleview(const Arg *arg)
@@ -2975,6 +3019,120 @@ toggleview(const Arg *arg)
printstatus();
}
@@ -168,7 +168,7 @@ index 4cfd0fd..e6d8433 100644
+ /* Find the client under the pointer and send the event along. */
+ xytonode(lx, ly, &surface, &c, NULL, &sx, &sy);
+ if (sloppyfocus)
+ focusclient(c, 0);
+ focusclient(c, NULL, 0);
+
+ if (surface != NULL) {
+ serial = wlr_seat_touch_notify_down(seat, surface, event->time_msec, event->touch_id, sx, sy);
@@ -238,11 +238,11 @@ index 4cfd0fd..e6d8433 100644
+
+ if (c != NULL && surface != NULL) {
+ if (sloppyfocus)
+ focusclient(c, 0);
+ focusclient(c, NULL, 0);
+ wlr_seat_touch_point_focus(seat, surface, event->time_msec, event->touch_id, sx, sy);
+ } else {
+ if (sloppyfocus)
+ focusclient(NULL, 0);
+ focusclient(NULL, NULL, 0);
+ wlr_seat_touch_point_clear_focus(seat, event->time_msec, event->touch_id);
+ }
+ wlr_seat_touch_notify_motion(seat, event->time_msec, event->touch_id, sx, sy);