From b9d36c8149536cff1aa229f59337dcfa2f70a37b Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 20 Jun 2017 17:51:45 -0400 Subject: Add dynamic output resizing for Wayland backend This allows outputs to: - Not support modesetting - Resize themselves --- example/shared.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'example/shared.c') diff --git a/example/shared.c b/example/shared.c index 0fe7270f..6af3042b 100644 --- a/example/shared.c +++ b/example/shared.c @@ -383,7 +383,9 @@ static void output_add_notify(struct wl_listener *listener, void *data) { fprintf(stderr, "Output '%s' added\n", output->name); fprintf(stderr, "%s %s %"PRId32"mm x %"PRId32"mm\n", output->make, output->model, output->phys_width, output->phys_height); - wlr_output_set_mode(output, output->modes->items[0]); + if (output->modes->length > 0) { + wlr_output_set_mode(output, output->modes->items[0]); + } struct output_state *ostate = calloc(1, sizeof(struct output_state)); clock_gettime(CLOCK_MONOTONIC, &ostate->last_frame); ostate->output = output; -- cgit v1.2.3