Check return value of wlr_renderer_begin()

Since [1], wlr_renderer_begin() can fail. Check its return value
and bail.

This fixes an assertion error (when begin() fails and then we try
to render something) after a GPU reset.

[1]: a541c9510a
This commit is contained in:
Simon Ser 2023-01-20 23:11:22 +01:00
parent a7b9f6fedc
commit 36f627d0fa
1 changed files with 3 additions and 1 deletions

View File

@ -1044,7 +1044,9 @@ void output_render(struct sway_output *output, struct timespec *when,
fullscreen_con = workspace->current.fullscreen;
}
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
if (!wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height)) {
return;
}
if (debug.damage == DAMAGE_RERENDER) {
int width, height;