Skip to content

Commit

Permalink
Add subsurfaces to the back that are meant to be below the parent sur…
Browse files Browse the repository at this point in the history
…face

Most applications add their subsurfaces above the parent, so we were blindly
adding them to the front. This patch checks if the subsurface should be
below, and adds it to the back in that case, or else adds it to the front.

Fixes #1206.
Fixes #1615.
  • Loading branch information
soreau committed Jan 17, 2024
1 parent 328398a commit 24439d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/view/surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ wf::wlr_surface_controller_t::wlr_surface_controller_t(wlr_surface *surface,
// Allocate memory, it will be auto-freed when the wlr objects are destroyed
auto sub_controller = new wlr_subsurface_controller_t(sub);
create_controller(sub->surface, sub_controller->get_subsurface_root());
wlr_subsurface *s;
wl_list_for_each(s, &surface->current.subsurfaces_below, current.link)
{
if (sub == s)
{
wf::scene::add_back(this->root, sub_controller->get_subsurface_root());
return;
}
}
wf::scene::add_front(this->root, sub_controller->get_subsurface_root());
});

Expand Down

0 comments on commit 24439d0

Please sign in to comment.