From 455a85723d0fd04c745f3ba65960e0112c22d5ec Mon Sep 17 00:00:00 2001 From: werapi Date: Mon, 1 Dec 2025 19:35:29 +0100 Subject: [PATCH] fix: prevent crash when touch motion occurs over layer surfaces --- src/mango.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mango.c b/src/mango.c index 33dc4c3a..390242b4 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5364,11 +5364,17 @@ void touchmotion(struct wl_listener *listener, void *data) { return; } - sx = lx - c->current.x; - sy = ly - c->current.y; + if (c->type == XDGShell || c->type == X11) { + sx = lx - c->current.x; + sy = ly - c->current.y; + if (sloppyfocus) + focusclient(c, 0); + } else { + LayerSurface *l = (LayerSurface *)c; + sx = lx - l->current.x; + sy = ly - l->current.y; + } - if (sloppyfocus) - focusclient(c, 0); wlr_seat_touch_point_focus(seat, surface, event->time_msec, event->touch_id, sx, sy); wlr_seat_touch_notify_motion(seat, event->time_msec, event->touch_id, sx,