diff options
author | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-07-23 13:25:47 -0500 |
---|---|---|
committer | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-07-23 13:28:15 -0500 |
commit | b04c73be3de62d2739b5bb85e40f0c9af1122903 (patch) | |
tree | afd087a4dc4845caf064d0b086ee9b8319317158 | |
parent | 8cdb9971264adfdc35777b5a9935c2e4c47eea9f (diff) |
make sure we do not create a double fullscreen_bg
and also make sure we do not destroy it if it does not exist
Fixes: #274
-rw-r--r-- | dwl.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1879,14 +1879,19 @@ setfullscreen(Client *c, int fullscreen) * * For brevity we set a black background for all clients */ - c->fullscreen_bg = wlr_scene_rect_create(c->scene, - c->geom.width, c->geom.height, fullscreen_bg); - wlr_scene_node_lower_to_bottom(&c->fullscreen_bg->node); + if (!c->fullscreen_bg) { + c->fullscreen_bg = wlr_scene_rect_create(c->scene, + c->geom.width, c->geom.height, fullscreen_bg); + wlr_scene_node_lower_to_bottom(&c->fullscreen_bg->node); + } } else { /* restore previous size instead of arrange for floating windows since * client positions are set by the user and cannot be recalculated */ resize(c, c->prev, 0); - wlr_scene_node_destroy(&c->fullscreen_bg->node); + if (c->fullscreen_bg) { + wlr_scene_node_destroy(&c->fullscreen_bg->node); + c->fullscreen_bg = NULL; + } } arrange(c->mon); printstatus(); |