There are situations where the data pointer of a parent is NULL.
Checking for NULL first fixes e.g. a segmentation fault in CLion
when opening the settings window from a popup menu.
See also https://github.com/labwc/labwc/issues/1351#issuecomment-
1867475324
return;
}
struct view *parent = (struct view *)surface->parent->data;
- if (!parent->toplevel.handle) {
+ if (!parent || !parent->toplevel.handle) {
return;
}
wlr_foreign_toplevel_handle_v1_set_parent(view->toplevel.handle, parent->toplevel.handle);