mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
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.
This commit is contained in:
parent
d1c88a22a3
commit
7dcb045176
1 changed files with 6 additions and 6 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue