Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
surface: add commit_request event
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Primak committed Oct 4, 2021
1 parent e446114 commit 776998d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/wlr/types/wlr_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ struct wlr_surface {
void *role_data; // role-specific data

struct {
// Fired on the current state update
struct wl_signal commit;
// Fired on wl_surface.commit request
struct wl_signal commit_request;
struct wl_signal new_subsurface;
struct wl_signal destroy;
} events;
Expand Down
3 changes: 3 additions & 0 deletions types/wlr_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ static void surface_handle_commit(struct wl_client *client,

surface_finalize_pending(surface);

wlr_signal_emit_safe(&surface->events.commit_request, surface);

if (surface->pending.cached_state_locks > 0 || !wl_list_empty(&surface->cached)) {
surface_cache_pending(surface);
} else {
Expand Down Expand Up @@ -745,6 +747,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.commit_request);
wl_signal_init(&surface->events.destroy);
wl_signal_init(&surface->events.new_subsurface);
wl_list_init(&surface->current_outputs);
Expand Down

0 comments on commit 776998d

Please sign in to comment.