From 956b0cc6a476447acd027488d266e5fa9180226f Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sat, 16 Jan 2021 22:20:37 +0000 Subject: [PATCH] output: chase swaywm/wlroots@cc56b4f07373 output.c:456:36: error: no member named 'transform' in 'struct wlr_output::(anonymous at /usr/local/include/wlr/types/wlr_output.h:154:2)' wl_signal_add(&wlr_output->events.transform, &output->transform); ~~~~~~~~~~~~~~~~~~ ^ Based on https://github.com/swaywm/sway/commit/2c76923282b1 --- output.c | 19 +++++++++++-------- output.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/output.c b/output.c index 4c4d77a..d8da3b9 100644 --- a/output.c +++ b/output.c @@ -358,17 +358,20 @@ frame_done: } static void -handle_output_transform(struct wl_listener *listener, void *data) +handle_output_commit(struct wl_listener *listener, void *data) { - struct cg_output *output = wl_container_of(listener, output, transform); + struct cg_output *output = wl_container_of(listener, output, commit); + struct wlr_output_event_commit *event = data; if (!output->wlr_output->enabled) { return; } - struct cg_view *view; - wl_list_for_each (view, &output->server->views, link) { - view_position(view); + if (event->committed & WLR_OUTPUT_STATE_TRANSFORM) { + struct cg_view *view; + wl_list_for_each (view, &output->server->views, link) { + view_position(view); + } } } @@ -393,8 +396,8 @@ output_destroy(struct cg_output *output) struct cg_server *server = output->server; wl_list_remove(&output->destroy.link); + wl_list_remove(&output->commit.link); wl_list_remove(&output->mode.link); - wl_list_remove(&output->transform.link); wl_list_remove(&output->damage_frame.link); wl_list_remove(&output->damage_destroy.link); wl_list_remove(&output->link); @@ -450,10 +453,10 @@ handle_new_output(struct wl_listener *listener, void *data) output->damage = wlr_output_damage_create(wlr_output); wl_list_insert(&server->outputs, &output->link); + output->commit.notify = handle_output_commit; + wl_signal_add(&wlr_output->events.commit, &output->commit); output->mode.notify = handle_output_mode; wl_signal_add(&wlr_output->events.mode, &output->mode); - output->transform.notify = handle_output_transform; - wl_signal_add(&wlr_output->events.transform, &output->transform); output->destroy.notify = handle_output_destroy; wl_signal_add(&wlr_output->events.destroy, &output->destroy); output->damage_frame.notify = handle_output_damage_frame; diff --git a/output.h b/output.h index a573df9..b3fd3b4 100644 --- a/output.h +++ b/output.h @@ -13,8 +13,8 @@ struct cg_output { struct wlr_output *wlr_output; struct wlr_output_damage *damage; + struct wl_listener commit; struct wl_listener mode; - struct wl_listener transform; struct wl_listener destroy; struct wl_listener damage_frame; struct wl_listener damage_destroy;