diff options
Diffstat (limited to 'examples/scene-graph.c')
-rw-r--r-- | examples/scene-graph.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/scene-graph.c b/examples/scene-graph.c index 3d75164b..68441c11 100644 --- a/examples/scene-graph.c +++ b/examples/scene-graph.c @@ -81,10 +81,12 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) { output->scene_output = wlr_scene_output_create(server->scene, wlr_output); - if (!wl_list_empty(&wlr_output->modes)) { - struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); - wlr_output_set_mode(wlr_output, mode); - wlr_output_commit(wlr_output); + struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); + if (mode != NULL) { + struct wlr_output_state state = {0}; + wlr_output_state_set_mode(&state, mode); + wlr_output_commit_state(wlr_output, &state); + wlr_output_state_finish(&state); } wlr_output_create_global(wlr_output); |