aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-09-21 20:15:27 +1000
committerGitHub <noreply@github.com>2018-09-21 20:15:27 +1000
commit057635f1a32034ffc07faa92a1228b8b6454e6fa (patch)
tree86e1ab4983fec3586a8bbb0044216216e22cc1cb /sway
parentfa4308c5abecaeef870aced574e9d05e24e62392 (diff)
parent0798fadff2f2f74a7efd7c14c55737bac19de954 (diff)
Merge pull request #2665 from emersion/render-output-segfault
Fix segfault in output_render
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/render.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 1d2f445d..af4e2905 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -914,12 +914,17 @@ void output_render(struct sway_output *output, struct timespec *when,
struct wlr_output *wlr_output = output->wlr_output;
struct wlr_renderer *renderer =
- wlr_backend_get_renderer(wlr_output->backend);
+ wlr_backend_get_renderer(wlr_output->backend);
if (!sway_assert(renderer != NULL,
"expected the output backend to have a renderer")) {
return;
}
+ struct sway_workspace *workspace = output->current.active_workspace;
+ if (workspace == NULL) {
+ return;
+ }
+
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
if (!pixman_region32_not_empty(damage)) {
@@ -935,13 +940,11 @@ void output_render(struct sway_output *output, struct timespec *when,
pixman_region32_union_rect(damage, damage, 0, 0, width, height);
}
- struct sway_workspace *workspace = output->current.active_workspace;
- struct sway_container *fullscreen_con = workspace->current.fullscreen;
-
if (output_has_opaque_overlay_layer_surface(output)) {
goto render_overlay;
}
+ struct sway_container *fullscreen_con = workspace->current.fullscreen;
if (fullscreen_con) {
float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f};