diff options
author | Simon Ser <contact@emersion.fr> | 2020-06-19 16:07:49 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-06-19 11:50:42 -0600 |
commit | 155d57b01d6870bec6f1d865f1693dddf0a1e6ff (patch) | |
tree | 09d5fc05c089b7a6cfd1d62528bef0df4ce23655 | |
parent | 3c5dbfd97c77388686e5bec983a8e4705de27afe (diff) |
output: fix dangling renderer context after wlr_output_preferred_read_format
attach_render was called without un-setting the current rendering
context afterwards.
Closes: https://github.com/swaywm/wlroots/issues/2164
-rw-r--r-- | types/wlr_output.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c index c0849e84..ce05f97b 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -448,15 +448,16 @@ bool wlr_output_attach_render(struct wlr_output *output, int *buffer_age) { bool wlr_output_preferred_read_format(struct wlr_output *output, enum wl_shm_format *fmt) { - if (!output->impl->attach_render(output, NULL)) { + struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend); + if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) { return false; } - struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend); - if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) { + if (!output->impl->attach_render(output, NULL)) { return false; } *fmt = renderer->impl->preferred_read_format(renderer); + output->impl->rollback_render(output); return true; } |