mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-19 06:59:48 -05:00
surface: add cache event
This commit is contained in:
parent
3fdf8cf07e
commit
0f9ecac3cb
2 changed files with 9 additions and 0 deletions
|
|
@ -135,6 +135,12 @@ struct wlr_surface {
|
|||
|
||||
struct {
|
||||
struct wl_signal commit;
|
||||
/**
|
||||
* Emitted when the pending state is cached.
|
||||
*
|
||||
* Can be used by surface extensions to tie their own state to commits.
|
||||
*/
|
||||
struct wl_signal cache; // struct wlr_surface_state *
|
||||
struct wl_signal new_subsurface;
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
|
|
|||
|
|
@ -417,6 +417,8 @@ static void surface_cache_pending(struct wlr_surface *surface) {
|
|||
wl_list_insert(surface->cached.prev, &cached->cached_state_link);
|
||||
|
||||
surface->pending.seq++;
|
||||
|
||||
wlr_signal_emit_safe(&surface->events.cache, cached);
|
||||
}
|
||||
|
||||
static void surface_commit_state(struct wlr_surface *surface,
|
||||
|
|
@ -746,6 +748,7 @@ struct wlr_surface *surface_create(struct wl_client *client,
|
|||
surface->pending.seq = 1;
|
||||
|
||||
wl_signal_init(&surface->events.commit);
|
||||
wl_signal_init(&surface->events.cache);
|
||||
wl_signal_init(&surface->events.destroy);
|
||||
wl_signal_init(&surface->events.new_subsurface);
|
||||
wl_list_init(&surface->subsurfaces_above);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue