diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c index 220534931..aa55adb8f 100644 --- a/examples/fullscreen-shell.c +++ b/examples/fullscreen-shell.c @@ -165,14 +165,15 @@ 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_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(wlr_output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(wlr_output, &state); + wlr_output_state_finish(&state); } static void server_handle_present_surface(struct wl_listener *listener, diff --git a/examples/output-layers.c b/examples/output-layers.c index 092394f57..cec3b50b4 100644 --- a/examples/output-layers.c +++ b/examples/output-layers.c @@ -174,14 +174,15 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&wlr_output->events.frame, &output->frame); wl_list_insert(&server->outputs, &output->link); + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(wlr_output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(wlr_output, &state); + wlr_output_state_finish(&state); wlr_output_create_global(wlr_output); } diff --git a/examples/output-layout.c b/examples/output-layout.c index 1cd7d6e93..99d403e0d 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -177,14 +177,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) { wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(output, &state); + wlr_output_state_finish(&state); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/pointer.c b/examples/pointer.c index 127b77f35..f6ae30b4f 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -279,14 +279,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) { wlr_xcursor_manager_set_cursor_image(sample->xcursor_manager, "default", sample->cursor); + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(output, &state); + wlr_output_state_finish(&state); } diff --git a/examples/rotation.c b/examples/rotation.c index 2770529f2..e092a3634 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -123,10 +123,6 @@ static void new_output_notify(struct wl_listener *listener, void *data) { sample_output->x_offs = sample_output->y_offs = 0; sample_output->x_vel = sample_output->y_vel = 128; - struct wlr_output_state state; - wlr_output_state_init(&state); - wlr_output_state_set_transform(&state, sample->transform); - sample_output->output = output; sample_output->sample = sample; wl_signal_add(&output->events.frame, &sample_output->frame); @@ -135,11 +131,14 @@ static void new_output_notify(struct wl_listener *listener, void *data) { sample_output->destroy.notify = output_remove_notify; wl_list_insert(&sample->outputs, &sample_output->link); + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_transform(&state, sample->transform); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(output); if (mode != NULL) { wlr_output_state_set_mode(&state, mode); } - wlr_output_commit_state(output, &state); wlr_output_state_finish(&state); } diff --git a/examples/scene-graph.c b/examples/scene-graph.c index 0ea61c282..3cf150d07 100644 --- a/examples/scene-graph.c +++ b/examples/scene-graph.c @@ -81,14 +81,15 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) { output->scene_output = wlr_scene_output_create(server->scene, wlr_output); + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(wlr_output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(wlr_output, &state); + wlr_output_state_finish(&state); wlr_output_create_global(wlr_output); } diff --git a/examples/simple.c b/examples/simple.c index 533e42b59..781ee0e9f 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -106,14 +106,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) { wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(sample_output->output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(output, &state); + wlr_output_state_finish(&state); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/tablet.c b/examples/tablet.c index fc2094f5a..c992e0a4b 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -278,14 +278,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) { wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(output, &state); + wlr_output_state_finish(&state); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/touch.c b/examples/touch.c index c054fea97..f32b5bbac 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -183,14 +183,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) { wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + struct wlr_output_state state; + wlr_output_state_init(&state); + wlr_output_state_set_enabled(&state, true); struct wlr_output_mode *mode = wlr_output_preferred_mode(output); if (mode != NULL) { - struct wlr_output_state state; - wlr_output_state_init(&state); wlr_output_state_set_mode(&state, mode); - wlr_output_commit_state(output, &state); - wlr_output_state_finish(&state); } + wlr_output_commit_state(output, &state); + wlr_output_state_finish(&state); } static void keyboard_key_notify(struct wl_listener *listener, void *data) {