From b627885788acbab4c768632f800e010467ffbaf9 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Sat, 27 Sep 2025 02:50:40 +0200 Subject: decoration: reduce virtual calls this shows up as top contender in idle cpu usage, because decos in animations keeps locking weak pointers to shared pointers per window per frame when its not really needed, use weakpointers all the way and it drops to a bottom contender. marginal gains in the big picture. but gains is gains. --- src/desktop/Window.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/desktop/Window.cpp') diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index ba0f09d5..49b1b698 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -147,7 +147,7 @@ SBoxExtents CWindow::getFullWindowExtents() { SBoxExtents maxExtents = {.topLeft = {BORDERSIZE + 2, BORDERSIZE + 2}, .bottomRight = {BORDERSIZE + 2, BORDERSIZE + 2}}; - const auto EXTENTS = g_pDecorationPositioner->getWindowDecorationExtents(m_self.lock()); + const auto EXTENTS = g_pDecorationPositioner->getWindowDecorationExtents(m_self); maxExtents.topLeft.x = std::max(EXTENTS.topLeft.x, maxExtents.topLeft.x); @@ -241,11 +241,11 @@ CBox CWindow::getWindowIdealBoundingBoxIgnoreReserved() { SBoxExtents CWindow::getWindowExtentsUnified(uint64_t properties) { SBoxExtents extents = {.topLeft = {0, 0}, .bottomRight = {0, 0}}; if (properties & RESERVED_EXTENTS) - extents.addExtents(g_pDecorationPositioner->getWindowDecorationReserved(m_self.lock())); + extents.addExtents(g_pDecorationPositioner->getWindowDecorationReserved(m_self)); if (properties & INPUT_EXTENTS) - extents.addExtents(g_pDecorationPositioner->getWindowDecorationExtents(m_self.lock(), true)); + extents.addExtents(g_pDecorationPositioner->getWindowDecorationExtents(m_self, true)); if (properties & FULL_EXTENTS) - extents.addExtents(g_pDecorationPositioner->getWindowDecorationExtents(m_self.lock(), false)); + extents.addExtents(g_pDecorationPositioner->getWindowDecorationExtents(m_self, false)); return extents; } @@ -264,7 +264,7 @@ CBox CWindow::getWindowBoxUnified(uint64_t properties) { } SBoxExtents CWindow::getFullWindowReservedArea() { - return g_pDecorationPositioner->getWindowDecorationReserved(m_self.lock()); + return g_pDecorationPositioner->getWindowDecorationReserved(m_self); } void CWindow::updateWindowDecos() { -- cgit v1.2.3