diff options
author | emersion <contact@emersion.fr> | 2018-09-19 11:03:25 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-09-19 11:03:25 +0200 |
commit | 4289343e17615509fba5fe389d855f2292ba09bc (patch) | |
tree | b2116e1cd971ba5eb4d613b2e0fb9906971a654c /sway | |
parent | Merge pull request #2652 from emersion/swaybar-output-names (diff) | |
download | sway-4289343e17615509fba5fe389d855f2292ba09bc.tar.gz sway-4289343e17615509fba5fe389d855f2292ba09bc.tar.zst sway-4289343e17615509fba5fe389d855f2292ba09bc.zip |
Fix segfault in output_render
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/render.c | 11 |
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, | |||
914 | struct wlr_output *wlr_output = output->wlr_output; | 914 | struct wlr_output *wlr_output = output->wlr_output; |
915 | 915 | ||
916 | struct wlr_renderer *renderer = | 916 | struct wlr_renderer *renderer = |
917 | wlr_backend_get_renderer(wlr_output->backend); | 917 | wlr_backend_get_renderer(wlr_output->backend); |
918 | if (!sway_assert(renderer != NULL, | 918 | if (!sway_assert(renderer != NULL, |
919 | "expected the output backend to have a renderer")) { | 919 | "expected the output backend to have a renderer")) { |
920 | return; | 920 | return; |
921 | } | 921 | } |
922 | 922 | ||
923 | struct sway_workspace *workspace = output->current.active_workspace; | ||
924 | if (workspace == NULL) { | ||
925 | return; | ||
926 | } | ||
927 | |||
923 | wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); | 928 | wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); |
924 | 929 | ||
925 | if (!pixman_region32_not_empty(damage)) { | 930 | if (!pixman_region32_not_empty(damage)) { |
@@ -935,13 +940,11 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
935 | pixman_region32_union_rect(damage, damage, 0, 0, width, height); | 940 | pixman_region32_union_rect(damage, damage, 0, 0, width, height); |
936 | } | 941 | } |
937 | 942 | ||
938 | struct sway_workspace *workspace = output->current.active_workspace; | ||
939 | struct sway_container *fullscreen_con = workspace->current.fullscreen; | ||
940 | |||
941 | if (output_has_opaque_overlay_layer_surface(output)) { | 943 | if (output_has_opaque_overlay_layer_surface(output)) { |
942 | goto render_overlay; | 944 | goto render_overlay; |
943 | } | 945 | } |
944 | 946 | ||
947 | struct sway_container *fullscreen_con = workspace->current.fullscreen; | ||
945 | if (fullscreen_con) { | 948 | if (fullscreen_con) { |
946 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; | 949 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; |
947 | 950 | ||