renderer: fix uv calculations once and for all (#11770)

fixes synchronization of ackd sizes, fixes wrong xdg stuff
This commit is contained in:
Vaxry 2025-09-21 19:27:56 +02:00 committed by GitHub
parent 41dad38177
commit 26cbc67385
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 85 additions and 48 deletions

View file

@ -174,27 +174,33 @@ CBox CSurfacePassElement::getTexBox() {
// center the surface if it's smaller than the viewport we assign it
if (PSURFACE && !PSURFACE->m_fillIgnoreSmall && PSURFACE->small() /* guarantees PWINDOW */) {
const auto CORRECT = PSURFACE->correctSmallVec();
const auto SIZE = PSURFACE->getViewporterCorrectedSize();
const auto CORRECT = PSURFACE->correctSmallVec();
const auto SIZE = PSURFACE->getViewporterCorrectedSize();
const auto REPORTED = PWINDOW->getReportedSize();
if (!INTERACTIVERESIZEINPROGRESS) {
windowBox.translate(CORRECT);
windowBox.width = SIZE.x * (PWINDOW->m_realSize->value().x / PWINDOW->m_reportedSize.x);
windowBox.height = SIZE.y * (PWINDOW->m_realSize->value().y / PWINDOW->m_reportedSize.y);
windowBox.width = SIZE.x * (PWINDOW->m_realSize->value().x / REPORTED.x);
windowBox.height = SIZE.y * (PWINDOW->m_realSize->value().y / REPORTED.y);
} else {
windowBox.width = SIZE.x;
windowBox.height = SIZE.y;
}
}
} else { // here we clamp to 2, these might be some tiny specks
windowBox = {sc<int>(outputX) + m_data.pos.x + m_data.localPos.x, sc<int>(outputY) + m_data.pos.y + m_data.localPos.y,
std::max(sc<float>(m_data.surface->m_current.size.x), 2.F), std::max(sc<float>(m_data.surface->m_current.size.y), 2.F)};
const auto SURFSIZE = m_data.surface->m_current.size;
windowBox = {sc<int>(outputX) + m_data.pos.x + m_data.localPos.x, sc<int>(outputY) + m_data.pos.y + m_data.localPos.y, std::max(sc<float>(SURFSIZE.x), 2.F),
std::max(sc<float>(SURFSIZE.y), 2.F)};
if (m_data.pWindow && m_data.pWindow->m_realSize->isBeingAnimated() && m_data.surface && !m_data.mainSurface && m_data.squishOversized /* subsurface */) {
// adjust subsurfaces to the window
windowBox.width = (windowBox.width / m_data.pWindow->m_reportedSize.x) * m_data.pWindow->m_realSize->value().x;
windowBox.height = (windowBox.height / m_data.pWindow->m_reportedSize.y) * m_data.pWindow->m_realSize->value().y;
const auto REPORTED = m_data.pWindow->getReportedSize();
if (REPORTED.x != 0 && REPORTED.y != 0) {
windowBox.width = (windowBox.width / REPORTED.x) * m_data.pWindow->m_realSize->value().x;
windowBox.height = (windowBox.height / REPORTED.y) * m_data.pWindow->m_realSize->value().y;
}
}
}