diff options
Diffstat (limited to 'examples/pointer.c')
-rw-r--r-- | examples/pointer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/pointer.c b/examples/pointer.c index 96c07667..399b1de6 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -252,8 +252,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; |