diff options
author | Simon Ser <contact@emersion.fr> | 2020-11-26 11:13:52 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-12-13 12:16:28 +0100 |
commit | 038285d49671a30750ee06fb24b923ccca29cca5 (patch) | |
tree | c9e72370c47270e59563eda6204fc2f6b4763824 /backend | |
parent | 768131e4883ed8b04ced6b453721fc28dbf61577 (diff) |
backend/wayland: stop rendering black frame on init
Instead of rendering a black frame, schedule a frame event to ask the
compositor to render a proper frame.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/wayland/output.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 87b06808..77412056 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -565,25 +565,6 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) { wl_display_roundtrip(output->backend->remote_display); - // start rendering loop per callbacks by rendering first frame - if (!wlr_egl_make_current(&output->backend->egl, output->egl_surface, - NULL)) { - goto error; - } - - wlr_renderer_begin(backend->renderer, wlr_output->width, wlr_output->height); - wlr_renderer_clear(backend->renderer, (float[]){ 1.0, 1.0, 1.0, 1.0 }); - wlr_renderer_end(backend->renderer); - - output->frame_callback = wl_surface_frame(output->surface); - wl_callback_add_listener(output->frame_callback, &frame_listener, output); - - if (!wlr_egl_swap_buffers(&output->backend->egl, output->egl_surface, - NULL)) { - goto error; - } - wlr_output->frame_pending = true; - wl_list_insert(&backend->outputs, &output->link); wlr_output_update_enabled(wlr_output, true); @@ -596,6 +577,9 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) { } } + // Start the rendering loop by requesting the compositor to render a frame + wlr_output_schedule_frame(wlr_output); + return wlr_output; error: |