feat: add more protocols + touch support:

* add touch support (experimental)
* add support for wlr_cursor_shape_v1
* add support for wlr_relative_pointer_manager_v1
This commit is contained in:
DL
2025-07-29 15:33:19 +02:00
parent 0b738f4476
commit 0f31545ccd
11 changed files with 639 additions and 60 deletions

19
node.c
View File

@@ -37,7 +37,7 @@ struct diyac_view *diyac_view_from_node(struct wlr_scene_node *wlr_scene_node)
return (struct diyac_view *)node_descriptor->data;
}
struct diyac_node_descriptor * diyac_node_at(struct diyac_server* server, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy)
struct diyac_node_descriptor *diyac_node_at(struct diyac_server *server, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy)
{
/* This returns the topmost node in the scene at the given layout coords.
* We only care about surface nodes as we are specifically looking for a
@@ -65,4 +65,21 @@ struct diyac_node_descriptor * diyac_node_at(struct diyac_server* server, double
tree = tree->node.parent;
}
return tree->node.data;
}
struct wlr_surface *diyac_wlr_surface_from_node(struct wlr_scene_node *node)
{
struct wlr_scene_buffer *buffer;
struct wlr_scene_surface *scene_surface;
if (node && node->type == WLR_SCENE_NODE_BUFFER)
{
buffer = wlr_scene_buffer_from_node(node);
scene_surface = wlr_scene_surface_try_from_buffer(buffer);
if (scene_surface)
{
return scene_surface->surface;
}
}
return NULL;
}