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 (WayfireWM#2099)

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 WayfireWM#1206.
Fixes WayfireWM#1615.
  • Loading branch information
soreau authored and lilydjwg committed Jan 21, 2024
1 parent 4f69978 commit eebbd2a
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 eebbd2a

Please sign in to comment.