aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-08-14 10:31:27 +0200
committerDrew DeVault <sir@cmpwn.com>2020-08-14 09:57:31 -0600
commit801c7670b765aae8dbd72c87e72d0ff9ff8f6cfb (patch)
treeb561f49c7c3753a414e0a038da4cebad44b542bf /examples
parentc236f60bb6206020396e608d6032c116fe028106 (diff)
examples/simple: use wlr_output_preferred_mode
Diffstat (limited to 'examples')
-rw-r--r--examples/simple.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/simple.c b/examples/simple.c
index 8540892d..965e97be 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -80,9 +80,9 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
wl_container_of(listener, sample, new_output);
struct sample_output *sample_output =
calloc(1, sizeof(struct sample_output));
- if (!wl_list_empty(&output->modes)) {
- struct wlr_output_mode *mode =
- wl_container_of(output->modes.prev, mode, link);
+
+ struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
+ if (mode != NULL) {
wlr_output_set_mode(output, mode);
}
sample_output->output = output;