From 9a1d0e42d2c8eda68bba1c1b4dfecc4bf6485baa Mon Sep 17 00:00:00 2001 From: Timidger Date: Thu, 10 May 2018 19:03:36 -0700 Subject: Fixed emersion's issues --- examples/rotation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/rotation.c') diff --git a/examples/rotation.c b/examples/rotation.c index 4a30cd96..0ee9964c 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -110,8 +110,8 @@ void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); - if (wl_list_length(&output->modes) > 0) { - struct wlr_output_mode *mode = wl_container_of((&output->modes)->prev, mode, link); + if (!wl_list_empty(&output->modes)) { + struct wlr_output_mode *mode = wl_container_of(output->modes.prev, mode, link); wlr_output_set_mode(output, mode); } sample_output->x_offs = sample_output->y_offs = 0; -- cgit v1.2.3