output-damage: stop listening to scale/transform events

Only listen to the commit event.
master
Simon Ser 4 years ago
parent a6a0568316
commit f6f46b4ee2

@ -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;

@ -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);

Loading…
Cancel
Save