From f6f46b4ee21b8e8a044c4e7a02c114ec2b85dbaa Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 10 Jan 2021 16:56:41 +0100 Subject: [PATCH] output-damage: stop listening to scale/transform events Only listen to the commit event. --- include/wlr/types/wlr_output_damage.h | 2 -- types/wlr_output_damage.c | 22 ++++------------------ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/include/wlr/types/wlr_output_damage.h b/include/wlr/types/wlr_output_damage.h index 4cdb0a54..39d28263 100644 --- a/include/wlr/types/wlr_output_damage.h +++ b/include/wlr/types/wlr_output_damage.h @@ -49,8 +49,6 @@ struct wlr_output_damage { struct wl_listener output_destroy; struct wl_listener output_mode; - struct wl_listener output_transform; - struct wl_listener output_scale; struct wl_listener output_needs_frame; struct wl_listener output_damage; struct wl_listener output_frame; diff --git a/types/wlr_output_damage.c b/types/wlr_output_damage.c index 35949412..2bfc193e 100644 --- a/types/wlr_output_damage.c +++ b/types/wlr_output_damage.c @@ -19,18 +19,6 @@ static void output_handle_mode(struct wl_listener *listener, void *data) { wlr_output_damage_add_whole(output_damage); } -static void output_handle_transform(struct wl_listener *listener, void *data) { - struct wlr_output_damage *output_damage = - wl_container_of(listener, output_damage, output_transform); - wlr_output_damage_add_whole(output_damage); -} - -static void output_handle_scale(struct wl_listener *listener, void *data) { - struct wlr_output_damage *output_damage = - wl_container_of(listener, output_damage, output_scale); - wlr_output_damage_add_whole(output_damage); -} - static void output_handle_needs_frame(struct wl_listener *listener, void *data) { struct wlr_output_damage *output_damage = @@ -61,6 +49,10 @@ static void output_handle_commit(struct wl_listener *listener, void *data) { wl_container_of(listener, output_damage, output_commit); struct wlr_output_event_commit *event = data; + if (event->committed & (WLR_OUTPUT_STATE_SCALE | WLR_OUTPUT_STATE_TRANSFORM)) { + wlr_output_damage_add_whole(output_damage); + } + if (!(event->committed & WLR_OUTPUT_STATE_BUFFER)) { return; } @@ -108,10 +100,6 @@ struct wlr_output_damage *wlr_output_damage_create(struct wlr_output *output) { output_damage->output_destroy.notify = output_handle_destroy; wl_signal_add(&output->events.mode, &output_damage->output_mode); output_damage->output_mode.notify = output_handle_mode; - wl_signal_add(&output->events.transform, &output_damage->output_transform); - output_damage->output_transform.notify = output_handle_transform; - wl_signal_add(&output->events.scale, &output_damage->output_scale); - output_damage->output_scale.notify = output_handle_scale; wl_signal_add(&output->events.needs_frame, &output_damage->output_needs_frame); output_damage->output_needs_frame.notify = output_handle_needs_frame; wl_signal_add(&output->events.damage, &output_damage->output_damage); @@ -131,8 +119,6 @@ void wlr_output_damage_destroy(struct wlr_output_damage *output_damage) { wlr_signal_emit_safe(&output_damage->events.destroy, output_damage); wl_list_remove(&output_damage->output_destroy.link); wl_list_remove(&output_damage->output_mode.link); - wl_list_remove(&output_damage->output_transform.link); - wl_list_remove(&output_damage->output_scale.link); wl_list_remove(&output_damage->output_needs_frame.link); wl_list_remove(&output_damage->output_damage.link); wl_list_remove(&output_damage->output_frame.link);