diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-05-19 14:26:50 -0400 |
---|---|---|
committer | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-05-19 14:26:50 -0400 |
commit | dc9bc5683ad3427afddc04afb383dd56723b9016 (patch) | |
tree | bc7e766d8652c241ab62684baa22c33b94660b24 /tinywl/tinywl.c | |
parent | 5f43e1732a5933513790ebe306607a89bc9c0ad9 (diff) |
wlr_scene: Refactor wlr_scene_surface to be a helper on top of wlr_scene_buffer
Diffstat (limited to 'tinywl/tinywl.c')
-rw-r--r-- | tinywl/tinywl.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c index 783cc182..bf3fb433 100644 --- a/tinywl/tinywl.c +++ b/tinywl/tinywl.c @@ -341,10 +341,17 @@ static struct tinywl_view *desktop_view_at( * surface in the surface tree of a tinywl_view. */ struct wlr_scene_node *node = wlr_scene_node_at( &server->scene->node, lx, ly, sx, sy); - if (node == NULL || node->type != WLR_SCENE_NODE_SURFACE) { + if (node == NULL || node->type != WLR_SCENE_NODE_BUFFER) { return NULL; } - *surface = wlr_scene_surface_from_node(node)->surface; + struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node); + struct wlr_scene_surface *scene_surface = + wlr_scene_surface_from_buffer(scene_buffer); + if (!scene_surface) { + return NULL; + } + + *surface = scene_surface->surface; /* Find the node corresponding to the tinywl_view at the root of this * surface tree, it is the only one for which we set the data field. */ while (node != NULL && node->data == NULL) { |