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/touch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/touch.c') diff --git a/examples/touch.c b/examples/touch.c index 47f5793c..069fda74 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -153,8 +153,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->output = output; -- cgit v1.2.3