wlr_scene: Add a way to choose when input interactions happen on a buffer

This commit is contained in:
Alexander Orzechowski 2022-05-19 14:24:05 -04:00
parent 09c7fe0f90
commit 34be5da072
2 changed files with 20 additions and 2 deletions

View file

@ -771,12 +771,22 @@ struct wlr_scene_node *wlr_scene_node_at(struct wlr_scene_node *node,
struct wlr_scene_surface *scene_surface = wlr_scene_surface_from_node(node);
intersects = wlr_surface_point_accepts_input(scene_surface->surface, lx, ly);
break;
case WLR_SCENE_NODE_RECT:
case WLR_SCENE_NODE_BUFFER:;
case WLR_SCENE_NODE_RECT:;
int width, height;
scene_node_get_size(node, &width, &height);
intersects = lx >= 0 && lx < width && ly >= 0 && ly < height;
break;
case WLR_SCENE_NODE_BUFFER:;
struct wlr_scene_buffer *scene_buffer = scene_buffer_from_node(node);
if (scene_buffer->point_accepts_input) {
intersects = scene_buffer->point_accepts_input(scene_buffer, lx, ly);
} else {
int width, height;
scene_node_get_size(node, &width, &height);
intersects = lx >= 0 && lx < width && ly >= 0 && ly < height;
}
break;
}
if (intersects) {