refactor: Use new hyprutils casts (#11377)

This commit is contained in:
Kamikadze 2025-08-14 19:44:56 +05:00 committed by GitHub
parent aa6a78f0a4
commit beee22a95e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
116 changed files with 715 additions and 696 deletions

View file

@ -116,7 +116,7 @@ Vector2D CWLSubsurfaceResource::posRelativeToParent() {
while (surf->m_role->role() == SURFACE_ROLE_SUBSURFACE && std::ranges::find_if(surfacesVisited, [surf](const auto& other) { return surf == other; }) == surfacesVisited.end()) {
surfacesVisited.emplace_back(surf);
auto subsurface = ((CSubsurfaceRole*)m_parent->m_role.get())->m_subsurface.lock();
auto subsurface = sc<CSubsurfaceRole*>(m_parent->m_role.get())->m_subsurface.lock();
pos += subsurface->m_position;
surf = subsurface->m_parent.lock();
}
@ -133,7 +133,7 @@ SP<CWLSurfaceResource> CWLSubsurfaceResource::t1Parent() {
while (surf->m_role->role() == SURFACE_ROLE_SUBSURFACE && std::ranges::find_if(surfacesVisited, [surf](const auto& other) { return surf == other; }) == surfacesVisited.end()) {
surfacesVisited.emplace_back(surf);
auto subsurface = ((CSubsurfaceRole*)m_parent->m_role.get())->m_subsurface.lock();
auto subsurface = sc<CSubsurfaceRole*>(m_parent->m_role.get())->m_subsurface.lock();
surf = subsurface->m_parent.lock();
}
return surf;
@ -163,7 +163,7 @@ CWLSubcompositorResource::CWLSubcompositorResource(SP<CWlSubcompositor> resource
SP<CWLSurfaceResource> t1Parent = nullptr;
if (PARENT->m_role->role() == SURFACE_ROLE_SUBSURFACE) {
auto subsurface = ((CSubsurfaceRole*)PARENT->m_role.get())->m_subsurface.lock();
auto subsurface = sc<CSubsurfaceRole*>(PARENT->m_role.get())->m_subsurface.lock();
t1Parent = subsurface->t1Parent();
} else
t1Parent = PARENT;