Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
scene: fix place above/below if sibling == node
Browse files Browse the repository at this point in the history
Currently these functions remove the node from the scene if the sibling
argument is the same node as the node. Making this case a noop is much
more predictable behavior.
  • Loading branch information
ifreund committed Oct 12, 2021
1 parent dc22a06 commit fba262b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/scene/wlr_scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ void wlr_scene_node_place_above(struct wlr_scene_node *node,
struct wlr_scene_node *sibling) {
assert(node->parent == sibling->parent);

if (node->state.link.prev == &sibling->state.link) {
if (node == sibling || node->state.link.prev == &sibling->state.link) {
return;
}

Expand All @@ -457,7 +457,7 @@ void wlr_scene_node_place_below(struct wlr_scene_node *node,
struct wlr_scene_node *sibling) {
assert(node->parent == sibling->parent);

if (node->state.link.next == &sibling->state.link) {
if (node == sibling || node->state.link.next == &sibling->state.link) {
return;
}

Expand Down

0 comments on commit fba262b

Please sign in to comment.