mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-08-24 10:04:19 -05:00
monitor: solitary cannot have an underlying subsurface (#15958)
ref #15923
This commit is contained in:
@@ -1086,9 +1086,19 @@ SP<CWLSurfaceResource> CWindow::getSolitaryResource() const {
|
||||
if (res->m_subsurfaces.size() == 1) {
|
||||
if (res->m_subsurfaces[0].expired() || res->m_subsurfaces[0]->m_surface.expired())
|
||||
return nullptr;
|
||||
auto surf = res->m_subsurfaces[0]->m_surface.lock();
|
||||
|
||||
auto subsurf = res->m_subsurfaces[0];
|
||||
|
||||
// A subsurface under the main surface cannot result in a solitary resource
|
||||
if (subsurf->m_zIndex < 0)
|
||||
return nullptr;
|
||||
|
||||
auto surf = subsurf->m_surface.lock();
|
||||
|
||||
// check if the subsurface covers the main surface
|
||||
if (!surf || surf->m_subsurfaces.size() != 0 || surf->extends() != res->extends() || !surf->m_current.texture || !surf->m_current.texture->m_opaque)
|
||||
return nullptr;
|
||||
|
||||
return surf;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user