From d08dbc32a944e4173f9eac43eba04e52e615b724 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Fri, 27 Dec 2024 15:10:04 +0100 Subject: [PATCH] view-impl: add view dummy node when setting the surface root node --- src/view/view.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/view/view.cpp b/src/view/view.cpp index fb83d66c3..4e3084a52 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -144,6 +144,11 @@ void wf::view_interface_t::set_surface_root_node(scene::floating_inner_ptr surfa priv->dummy_node = std::make_shared(); this->priv->surface_root_node = surface_root_node; + // Plugins may want to add subsurfaces even before the view is mapped for the first time. + // This is why we add a dummy node to track the position of the main surface in the order of surfaces + // even before mapping the view for the first time. + wf::scene::add_front(surface_root_node, priv->dummy_node); + // Set up view content to scene. priv->transformed_node->set_children_list({surface_root_node}); }