return early if the client doesn't have monitor in setfloating

there is still a bug, but for now this prevents a segfault

Bug: https://github.com/djpohly/dwl/issues/472
This commit is contained in:
Leonardo Hernández Hernández 2023-09-03 11:44:30 -06:00
parent c1d8b77f7f
commit aea8dd6ae1
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

2
dwl.c
View File

@ -2026,6 +2026,8 @@ void
setfloating(Client *c, int floating) setfloating(Client *c, int floating)
{ {
c->isfloating = floating; c->isfloating = floating;
if (!c->mon)
return;
wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]); wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]);
arrange(c->mon); arrange(c->mon);
printstatus(); printstatus();