diff --git a/include/rootston/output.h b/include/rootston/output.h index a0b2b1b4..8d5550af 100644 --- a/include/rootston/output.h +++ b/include/rootston/output.h @@ -14,10 +14,12 @@ struct roots_output { struct roots_view *fullscreen_view; - struct wl_listener frame; struct timespec last_frame; pixman_region32_t damage, previous_damage; struct wl_event_source *repaint_timer; + + struct wl_listener frame; + struct wl_listener mode; }; void output_add_notify(struct wl_listener *listener, void *data); diff --git a/rootston/output.c b/rootston/output.c index 6b12898b..f7c113ca 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -471,6 +471,11 @@ void output_damage_from_view(struct roots_output *output, // TODO: subsurfaces, popups, etc } +static void output_handle_mode(struct wl_listener *listener, void *data) { + struct roots_output *output = wl_container_of(listener, output, mode); + output_damage_whole(output); +} + static void set_mode(struct wlr_output *output, struct roots_output_config *oc) { int mhz = (int)(oc->mode.refresh_rate * 1000); @@ -530,6 +535,8 @@ void output_add_notify(struct wl_listener *listener, void *data) { output->frame.notify = output_handle_frame; wl_signal_add(&wlr_output->events.frame, &output->frame); + output->mode.notify = output_handle_mode; + wl_signal_add(&wlr_output->events.mode, &output->mode); struct roots_output_config *output_config = roots_config_get_output(config, wlr_output);