diff options
author | Simon Ser <contact@emersion.fr> | 2023-11-24 16:50:17 +0100 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2023-11-26 11:56:28 +0000 |
commit | 7dcb045176ae72140c5e27abeca3e5fde982489c (patch) | |
tree | 72ef42a90a48c50630d76a982e0127acb8e574fa | |
parent | d1c88a22a363620f9eb1a6286f01c7aac197f260 (diff) |
viewporter: listen to client_commit
The commit event fires too late: we're interested in checking the
values at wl_surface.commit time, not after.
-rw-r--r-- | types/wlr_viewporter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/types/wlr_viewporter.c b/types/wlr_viewporter.c index a4a0d92d..cb5d1df1 100644 --- a/types/wlr_viewporter.c +++ b/types/wlr_viewporter.c @@ -13,7 +13,7 @@ struct wlr_viewport { struct wlr_addon addon; - struct wl_listener surface_commit; + struct wl_listener surface_client_commit; }; static const struct wp_viewport_interface viewport_impl; @@ -112,7 +112,7 @@ static void viewport_destroy(struct wlr_viewport *viewport) { wlr_addon_finish(&viewport->addon); wl_resource_set_user_data(viewport->resource, NULL); - wl_list_remove(&viewport->surface_commit.link); + wl_list_remove(&viewport->surface_client_commit.link); free(viewport); } @@ -131,10 +131,10 @@ static void viewport_handle_resource_destroy(struct wl_resource *resource) { viewport_destroy(viewport); } -static void viewport_handle_surface_commit(struct wl_listener *listener, +static void viewport_handle_surface_client_commit(struct wl_listener *listener, void *data) { struct wlr_viewport *viewport = - wl_container_of(listener, viewport, surface_commit); + wl_container_of(listener, viewport, surface_client_commit); struct wlr_surface_state *state = &viewport->surface->pending; @@ -195,8 +195,8 @@ static void viewporter_handle_get_viewport(struct wl_client *client, wlr_addon_init(&viewport->addon, &surface->addons, NULL, &surface_addon_impl); - viewport->surface_commit.notify = viewport_handle_surface_commit; - wl_signal_add(&surface->events.commit, &viewport->surface_commit); + viewport->surface_client_commit.notify = viewport_handle_surface_client_commit; + wl_signal_add(&surface->events.client_commit, &viewport->surface_client_commit); } static const struct wp_viewporter_interface viewporter_impl = { |