fix segfault if parent->mon is unset

This commit is contained in:
Dima Krasner 2022-07-25 08:14:33 +03:00 committed by Leonardo Hernández
parent 7eee0a8229
commit 9d2eb8483b

3
dwl.c
View File

@ -1436,7 +1436,8 @@ mapnotify(struct wl_listener *listener, void *data)
/* Set the same monitor and tags than its parent */
c->isfloating = 1;
wlr_scene_node_reparent(c->scene, layers[LyrFloat]);
setmon(c, p->mon, p->tags);
/* TODO recheck if !p->mon is possible with wlroots 0.16.0 */
setmon(c, p->mon ? p->mon : selmon, p->tags);
} else {
applyrules(c);
}