examples/simple: use wlr_output_preferred_mode

This commit is contained in:
Simon Ser 2020-08-14 10:31:27 +02:00 committed by Drew DeVault
parent c236f60bb6
commit 801c7670b7

View file

@ -80,9 +80,9 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
wl_container_of(listener, sample, new_output); wl_container_of(listener, sample, new_output);
struct sample_output *sample_output = struct sample_output *sample_output =
calloc(1, sizeof(struct sample_output)); calloc(1, sizeof(struct sample_output));
if (!wl_list_empty(&output->modes)) {
struct wlr_output_mode *mode = struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
wl_container_of(output->modes.prev, mode, link); if (mode != NULL) {
wlr_output_set_mode(output, mode); wlr_output_set_mode(output, mode);
} }
sample_output->output = output; sample_output->output = output;