mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-04 20:55:58 +01:00
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
This commit is contained in:
parent
3c5dbfd97c
commit
155d57b01d
1 changed files with 5 additions and 4 deletions
|
@ -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)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend);
|
||||
if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!output->impl->attach_render(output, NULL)) {
|
||||
return false;
|
||||
}
|
||||
*fmt = renderer->impl->preferred_read_format(renderer);
|
||||
output->impl->rollback_render(output);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue