From 2a8d3853867c42570ae094df1335d7dfe0a4c71d Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 13 Oct 2021 16:00:53 +0200 Subject: scene: assert that node != sibling in place above/below Currently these functions remove the node from the scene if the sibling argument is the same node as the node. To prevent confusion when misusing this API, assert that the nodes are distinct and document this. --- include/wlr/types/wlr_scene.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 3b3035d0..8180183f 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -129,11 +129,13 @@ void wlr_scene_node_set_enabled(struct wlr_scene_node *node, bool enabled); void wlr_scene_node_set_position(struct wlr_scene_node *node, int x, int y); /** * Move the node right above the specified sibling. + * Asserts that node and sibling are distinct and share the same parent. */ void wlr_scene_node_place_above(struct wlr_scene_node *node, struct wlr_scene_node *sibling); /** * Move the node right below the specified sibling. + * Asserts that node and sibling are distinct and share the same parent. */ void wlr_scene_node_place_below(struct wlr_scene_node *node, struct wlr_scene_node *sibling); -- cgit v1.2.3