From e165677f2c713e6d5a149bb6bf4b181718304b61 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 16 Aug 2022 21:27:14 +0100 Subject: [PATCH] update to use scene graph --- kiwmi/input/cursor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kiwmi/input/cursor.c b/kiwmi/input/cursor.c index eb03d0e..d391bd6 100644 --- a/kiwmi/input/cursor.c +++ b/kiwmi/input/cursor.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -144,7 +143,12 @@ cursor_touch_down_notify(struct wl_listener *listener, void *data) double ly = 1440 * event->y; double sx, sy; - (void)view_at(desktop, lx, ly, &surface, &sx, &sy); + struct wlr_scene_node *node_at = + wlr_scene_node_at(&desktop->scene->node, lx, ly, &sx, &sy); + + if (node_at && node_at->type == WLR_SCENE_NODE_SURFACE) { + surface = wlr_scene_surface_from_node(node_at)->surface; + } /* we send the event to lua with 0..1 co-ordinates, because * it may not be over any surface