mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-26 19:26:32 +00:00
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
This commit is contained in:
parent
8cdb997126
commit
b04c73be3d
1 changed files with 9 additions and 4 deletions
13
dwl.c
13
dwl.c
|
@ -1879,14 +1879,19 @@ setfullscreen(Client *c, int fullscreen)
|
||||||
*
|
*
|
||||||
* For brevity we set a black background for all clients
|
* For brevity we set a black background for all clients
|
||||||
*/
|
*/
|
||||||
c->fullscreen_bg = wlr_scene_rect_create(c->scene,
|
if (!c->fullscreen_bg) {
|
||||||
c->geom.width, c->geom.height, fullscreen_bg);
|
c->fullscreen_bg = wlr_scene_rect_create(c->scene,
|
||||||
wlr_scene_node_lower_to_bottom(&c->fullscreen_bg->node);
|
c->geom.width, c->geom.height, fullscreen_bg);
|
||||||
|
wlr_scene_node_lower_to_bottom(&c->fullscreen_bg->node);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* restore previous size instead of arrange for floating windows since
|
/* restore previous size instead of arrange for floating windows since
|
||||||
* client positions are set by the user and cannot be recalculated */
|
* client positions are set by the user and cannot be recalculated */
|
||||||
resize(c, c->prev, 0);
|
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);
|
arrange(c->mon);
|
||||||
printstatus();
|
printstatus();
|
||||||
|
|
Loading…
Reference in a new issue