attach_render and commit are all that's needed

attach_render tells the output that a "new" buffer has been prepared
(even if we haven't changed it).  We need to call that and then commit
it to keep the render loop going.

Software cursors will freeze momentarily during layout updates, but I
suspect that this is not as easily fixed as it sounds.  You can force
software cursors by running:

    WLR_NO_HARDWARE_CURSORS=1 ./dwl
main
Devin J. Pohly 2020-07-30 22:46:45 -05:00
parent 21437b62af
commit 4e57dbd922
1 changed files with 14 additions and 14 deletions

6
dwl.c
View File

@ -1256,15 +1256,13 @@ rendermon(struct wl_listener *listener, void *data)
if (!wlr_output_attach_render(m->wlr_output, NULL)) if (!wlr_output_attach_render(m->wlr_output, NULL))
return; return;
if (render) {
/* Begin the renderer (calls glViewport and some other GL sanity checks) */ /* Begin the renderer (calls glViewport and some other GL sanity checks) */
wlr_renderer_begin(drw, m->wlr_output->width, m->wlr_output->height); wlr_renderer_begin(drw, m->wlr_output->width, m->wlr_output->height);
if (render) {
wlr_renderer_clear(drw, rootcolor); wlr_renderer_clear(drw, rootcolor);
renderclients(m, &now); renderclients(m, &now);
renderindependents(output, &now); renderindependents(output, &now);
}
/* Hardware cursors are rendered by the GPU on a separate plane, and can be /* Hardware cursors are rendered by the GPU on a separate plane, and can be
* moved around without re-rendering what's beneath them - which is more * moved around without re-rendering what's beneath them - which is more
@ -1277,6 +1275,8 @@ rendermon(struct wl_listener *listener, void *data)
/* Conclude rendering and swap the buffers, showing the final frame /* Conclude rendering and swap the buffers, showing the final frame
* on-screen. */ * on-screen. */
wlr_renderer_end(drw); wlr_renderer_end(drw);
}
wlr_output_commit(m->wlr_output); wlr_output_commit(m->wlr_output);
} }