summaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 11:39:52 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 11:39:52 +1000
commit9642b87b9ed3b99d506738f54fc189776aa0adce (patch)
tree12d837b1d028f58ad1a99108417c1eeadda713e8 /sway/desktop/render.c
parentMerge pull request #2572 from RedSoxFan/wlr-output-disabling (diff)
downloadsway-9642b87b9ed3b99d506738f54fc189776aa0adce.tar.gz
sway-9642b87b9ed3b99d506738f54fc189776aa0adce.tar.zst
sway-9642b87b9ed3b99d506738f54fc189776aa0adce.zip
Fix crash when views rapidly map and unmap
Suppose the following: * Transactions are already in progress - say transaction A. * View A maps, which creates transaction B and appends it to the transaction queue. * View B maps, which creates transaction C and appends it to the queue. * View A unmaps, which creates transaction D and appends it to the queue. * Transaction A completes, so transaction B attempts to save View A's buffer, but this doesn't exist so it saves nothing. * Rendering code attempts to render View A, but there is no saved buffer nor live buffer that it can use. Rather than implement an elaborate solution for a rare circumstance, I've take the safe option of just not rendering anything for that view. It means that if you reproduce the scenario above, you might get the title and borders rendered but no surface.
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 9d80f3c7..bb3902ec 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -266,7 +266,7 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage,
266 struct sway_view *view = con->view; 266 struct sway_view *view = con->view;
267 if (view->saved_buffer) { 267 if (view->saved_buffer) {
268 render_saved_view(view, output, damage, view->container->alpha); 268 render_saved_view(view, output, damage, view->container->alpha);
269 } else { 269 } else if (view->surface) {
270 render_view_toplevels(view, output, damage, view->container->alpha); 270 render_view_toplevels(view, output, damage, view->container->alpha);
271 } 271 }
272 272