diff --git a/src/window_tree.cpp b/src/window_tree.cpp index b680b15..16428e5 100644 --- a/src/window_tree.cpp +++ b/src/window_tree.cpp @@ -278,7 +278,9 @@ std::shared_ptr Node::find_node_for_window(miral::Window &window) } else { - return item->get_node()->find_node_for_window(window); + auto retval = item->get_node()->find_node_for_window(window); + if (retval != nullptr) + return retval; } } @@ -297,7 +299,9 @@ std::shared_ptr Node::window_to_node(miral::Window &window) } else { - return item->get_node()->window_to_node(window); + auto node = item->get_node()->window_to_node(window); + if (node != nullptr) + return node; } }