aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-01-20 23:11:22 +0100
committerSimon Ser <contact@emersion.fr>2023-01-21 14:16:21 +0100
commit36f627d0fadf1d00e45662359246dad9a40c7a7f (patch)
tree7d5eff0f8890edc933bf35cc06896d61228e8db6 /sway
parenta7b9f6fedc8e625b9c950f43cad36cfc8fc6734c (diff)
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]: https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/a541c9510a4cf544313bc9b0503d75820b42444e
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/render.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 4d242bd7..2b7214c3 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -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;