mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-04-06 07:15:31 -04:00
Fix undefined behaviour in xytonode
Sometimes pnode->parent is NULL.
This commit is contained in:
parent
c1d8b77f7f
commit
36bbf8affc
1 changed files with 4 additions and 1 deletions
5
dwl.c
5
dwl.c
|
|
@ -2638,8 +2638,11 @@ xytonode(double x, double y, struct wlr_surface **psurface,
|
||||||
surface = wlr_scene_surface_from_buffer(
|
surface = wlr_scene_surface_from_buffer(
|
||||||
wlr_scene_buffer_from_node(node))->surface;
|
wlr_scene_buffer_from_node(node))->surface;
|
||||||
/* Walk the tree to find a node that knows the client */
|
/* Walk the tree to find a node that knows the client */
|
||||||
for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
|
for (pnode = node; pnode && !c; pnode = &pnode->parent->node) {
|
||||||
c = pnode->data;
|
c = pnode->data;
|
||||||
|
if (!pnode->parent)
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (c && c->type == LayerShell) {
|
if (c && c->type == LayerShell) {
|
||||||
c = NULL;
|
c = NULL;
|
||||||
l = pnode->data;
|
l = pnode->data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue