aboutsummaryrefslogtreecommitdiff
path: root/examples/rotation.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/rotation.c')
-rw-r--r--examples/rotation.c4
1 files changed, 2 insertions, 2 deletions
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;