output: handle size changes

Fixes #23.
This commit is contained in:
Jente Hidskes 2019-01-10 15:50:31 +01:00
parent 21c01c9ee0
commit a4a3a4954a
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA
4 changed files with 26 additions and 5 deletions

View file

@ -123,6 +123,17 @@ handle_output_frame(struct wl_listener *listener, void *data)
wlr_output_swap_buffers(output->wlr_output, NULL, NULL);
}
static void
handle_output_mode(struct wl_listener *listener, void *data)
{
struct cg_output *output = wl_container_of(listener, output, mode);
struct cg_view *view;
wl_list_for_each(view, &output->server->views, link) {
view_position(view);
}
}
static void
handle_output_destroy(struct wl_listener *listener, void *data)
{
@ -160,6 +171,8 @@ handle_new_output(struct wl_listener *listener, void *data)
server->output->frame.notify = handle_output_frame;
wl_signal_add(&wlr_output->events.frame, &server->output->frame);
server->output->mode.notify = handle_output_mode;
wl_signal_add(&wlr_output->events.mode, &server->output->mode);
server->output->destroy.notify = handle_output_destroy;
wl_signal_add(&wlr_output->events.destroy, &server->output->destroy);