wlr_scene: Amend scene_buffer.point_accepts_input to take coordinate pointers

The pointers mean that we can mutate them. This will be useful later
so we can hide details from the compositor when we clip subsurface trees.
This commit is contained in:
Alexander Orzechowski 2023-11-08 18:23:51 -05:00 committed by Isaac Freund
parent 6cf0bb4b19
commit 33b437d574
3 changed files with 4 additions and 4 deletions

View file

@ -45,7 +45,7 @@ struct wlr_linux_dmabuf_v1;
struct wlr_output_state; struct wlr_output_state;
typedef bool (*wlr_scene_buffer_point_accepts_input_func_t)( typedef bool (*wlr_scene_buffer_point_accepts_input_func_t)(
struct wlr_scene_buffer *buffer, int sx, int sy); struct wlr_scene_buffer *buffer, double *sx, double *sy);
typedef void (*wlr_scene_buffer_iterator_func_t)( typedef void (*wlr_scene_buffer_iterator_func_t)(
struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data); struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data);

View file

@ -148,11 +148,11 @@ static void handle_scene_surface_surface_commit(
} }
static bool scene_buffer_point_accepts_input(struct wlr_scene_buffer *scene_buffer, static bool scene_buffer_point_accepts_input(struct wlr_scene_buffer *scene_buffer,
int sx, int sy) { double *sx, double *sy) {
struct wlr_scene_surface *scene_surface = struct wlr_scene_surface *scene_surface =
wlr_scene_surface_try_from_buffer(scene_buffer); wlr_scene_surface_try_from_buffer(scene_buffer);
return wlr_surface_point_accepts_input(scene_surface->surface, sx, sy); return wlr_surface_point_accepts_input(scene_surface->surface, *sx, *sy);
} }
static void surface_addon_destroy(struct wlr_addon *addon) { static void surface_addon_destroy(struct wlr_addon *addon) {

View file

@ -1064,7 +1064,7 @@ static bool scene_node_at_iterator(struct wlr_scene_node *node,
struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node); struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node);
if (scene_buffer->point_accepts_input && if (scene_buffer->point_accepts_input &&
!scene_buffer->point_accepts_input(scene_buffer, rx, ry)) { !scene_buffer->point_accepts_input(scene_buffer, &rx, &ry)) {
return false; return false;
} }
} }