From 2fea2fced8350ce52b3ea9c2d3f62797f7e61b56 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sat, 8 Feb 2020 19:09:41 +1300 Subject: [PATCH] examples: Fix compositor-examples Due to the way the wlr_output API was changed, these examples would never get a frame event to start the rendering loop. We now commit the outputs to start it. --- examples/fullscreen-shell.c | 2 ++ examples/multi-pointer.c | 2 ++ examples/output-layout.c | 2 ++ examples/pointer.c | 2 ++ examples/rotation.c | 2 ++ examples/simple.c | 2 ++ examples/tablet.c | 2 ++ examples/touch.c | 2 ++ 8 files changed, 16 insertions(+) diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c index dbea9f049..cac8853bc 100644 --- a/examples/fullscreen-shell.c +++ b/examples/fullscreen-shell.c @@ -163,6 +163,8 @@ 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); + + wlr_output_commit(wlr_output); } static void server_handle_present_surface(struct wl_listener *listener, diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c index 28f6eca85..9f7bd6c8e 100644 --- a/examples/multi-pointer.c +++ b/examples/multi-pointer.c @@ -171,6 +171,8 @@ static void new_output_notify(struct wl_listener *listener, void *data) { cursor->cursor->y); } wl_list_insert(&sample->outputs, &sample_output->link); + + wlr_output_commit(output); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/output-layout.c b/examples/output-layout.c index 2a1cc320a..c9ca53a46 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -169,6 +169,8 @@ static void new_output_notify(struct wl_listener *listener, void *data) { sample_output->frame.notify = output_frame_notify; wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + + wlr_output_commit(output); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/pointer.c b/examples/pointer.c index 5e137a1a9..520742d76 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -265,6 +265,8 @@ static void new_output_notify(struct wl_listener *listener, void *data) { wlr_xcursor_manager_load(sample->xcursor_manager, output->scale); wlr_xcursor_manager_set_cursor_image(sample->xcursor_manager, "left_ptr", sample->cursor); + + wlr_output_commit(output); } diff --git a/examples/rotation.c b/examples/rotation.c index 3700351a1..e76cc2a4d 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -123,6 +123,8 @@ 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; wl_list_insert(&sample->outputs, &sample_output->link); + + wlr_output_commit(output); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/simple.c b/examples/simple.c index bf2411c88..8540892d6 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -91,6 +91,8 @@ static void new_output_notify(struct wl_listener *listener, void *data) { sample_output->frame.notify = output_frame_notify; wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + + wlr_output_commit(sample_output->output); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/tablet.c b/examples/tablet.c index d33fb224c..7721ef720 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -248,6 +248,8 @@ static void new_output_notify(struct wl_listener *listener, void *data) { sample_output->frame.notify = output_frame_notify; wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + + wlr_output_commit(output); } static void keyboard_key_notify(struct wl_listener *listener, void *data) { diff --git a/examples/touch.c b/examples/touch.c index 07d44563d..39dd1d457 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -161,6 +161,8 @@ static void new_output_notify(struct wl_listener *listener, void *data) { sample_output->frame.notify = output_frame_notify; wl_signal_add(&output->events.destroy, &sample_output->destroy); sample_output->destroy.notify = output_remove_notify; + + wlr_output_commit(output); } static void keyboard_key_notify(struct wl_listener *listener, void *data) {