output-damage: stop listening to scale/transform events

Only listen to the commit event.
This commit is contained in:
Simon Ser 2021-01-10 16:56:41 +01:00
parent a6a0568316
commit f6f46b4ee2
2 changed files with 4 additions and 20 deletions

View File

@ -49,8 +49,6 @@ struct wlr_output_damage {
struct wl_listener output_destroy; struct wl_listener output_destroy;
struct wl_listener output_mode; 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_needs_frame;
struct wl_listener output_damage; struct wl_listener output_damage;
struct wl_listener output_frame; struct wl_listener output_frame;

View File

@ -19,18 +19,6 @@ static void output_handle_mode(struct wl_listener *listener, void *data) {
wlr_output_damage_add_whole(output_damage); 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, static void output_handle_needs_frame(struct wl_listener *listener,
void *data) { void *data) {
struct wlr_output_damage *output_damage = 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); wl_container_of(listener, output_damage, output_commit);
struct wlr_output_event_commit *event = data; 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)) { if (!(event->committed & WLR_OUTPUT_STATE_BUFFER)) {
return; 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; output_damage->output_destroy.notify = output_handle_destroy;
wl_signal_add(&output->events.mode, &output_damage->output_mode); wl_signal_add(&output->events.mode, &output_damage->output_mode);
output_damage->output_mode.notify = output_handle_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); wl_signal_add(&output->events.needs_frame, &output_damage->output_needs_frame);
output_damage->output_needs_frame.notify = output_handle_needs_frame; output_damage->output_needs_frame.notify = output_handle_needs_frame;
wl_signal_add(&output->events.damage, &output_damage->output_damage); 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); wlr_signal_emit_safe(&output_damage->events.destroy, output_damage);
wl_list_remove(&output_damage->output_destroy.link); wl_list_remove(&output_damage->output_destroy.link);
wl_list_remove(&output_damage->output_mode.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_needs_frame.link);
wl_list_remove(&output_damage->output_damage.link); wl_list_remove(&output_damage->output_damage.link);
wl_list_remove(&output_damage->output_frame.link); wl_list_remove(&output_damage->output_frame.link);