diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-19 17:25:13 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-04-19 17:25:41 +0200 |
commit | fd7e565ce3ea463b725fcd5b4291411f030a4e2c (patch) | |
tree | f3ded874a6e2623f4c7b822b429821e3417e109f /examples/fullscreen-shell.c | |
parent | 3432ab2ba7d7c65d39c766f902ac915b60af52fd (diff) |
examples: use wlr_output_preferred_mode
Diffstat (limited to 'examples/fullscreen-shell.c')
-rw-r--r-- | examples/fullscreen-shell.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c index 9a2f7d7d..52776c55 100644 --- a/examples/fullscreen-shell.c +++ b/examples/fullscreen-shell.c @@ -146,12 +146,6 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) { wl_container_of(listener, server, new_output); struct wlr_output *wlr_output = data; - if (!wl_list_empty(&wlr_output->modes)) { - struct wlr_output_mode *mode = - wl_container_of(wlr_output->modes.prev, mode, link); - wlr_output_set_mode(wlr_output, mode); - } - struct fullscreen_output *output = calloc(1, sizeof(struct fullscreen_output)); output->wlr_output = wlr_output; @@ -163,6 +157,11 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) { wlr_output_layout_add_auto(server->output_layout, wlr_output); wlr_output_create_global(wlr_output); + struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); + if (mode != NULL) { + wlr_output_set_mode(wlr_output, mode); + } + wlr_output_commit(wlr_output); } |