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

View file

@ -1044,7 +1044,9 @@ void output_render(struct sway_output *output, struct timespec *when,
fullscreen_con = workspace->current.fullscreen; 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) { if (debug.damage == DAMAGE_RERENDER) {
int width, height; int width, height;