From 50827ed7f5f01ed2f03f67c5e9e55e13ede06748 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Thu, 13 Jan 2022 14:08:54 +0300 Subject: surface: improve role precommit hook Now the role precommit hook is called before the commit, not on wl_surface.commit request, and takes a state which is to be applied. --- include/types/wlr_xdg_shell.h | 3 ++- include/wlr/types/wlr_compositor.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/types/wlr_xdg_shell.h b/include/types/wlr_xdg_shell.h index 509b1d2c..8b2c66cc 100644 --- a/include/types/wlr_xdg_shell.h +++ b/include/types/wlr_xdg_shell.h @@ -20,7 +20,8 @@ void unmap_xdg_surface(struct wlr_xdg_surface *surface); void reset_xdg_surface(struct wlr_xdg_surface *xdg_surface); void destroy_xdg_surface(struct wlr_xdg_surface *surface); void handle_xdg_surface_commit(struct wlr_surface *wlr_surface); -void handle_xdg_surface_precommit(struct wlr_surface *wlr_surface); +void handle_xdg_surface_precommit(struct wlr_surface *wlr_surface, + const struct wlr_surface_state *state); void create_xdg_positioner(struct wlr_xdg_client *client, uint32_t id); struct wlr_xdg_positioner_resource *get_xdg_positioner_from_resource( diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h index 0146a8ab..071610b8 100644 --- a/include/wlr/types/wlr_compositor.h +++ b/include/wlr/types/wlr_compositor.h @@ -73,7 +73,8 @@ struct wlr_surface_state { struct wlr_surface_role { const char *name; void (*commit)(struct wlr_surface *surface); - void (*precommit)(struct wlr_surface *surface); + void (*precommit)(struct wlr_surface *surface, + const struct wlr_surface_state *state); }; struct wlr_surface_output { -- cgit v1.2.3