summaryrefslogtreecommitdiff
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2025-09-27 02:50:40 +0200
committerVaxry <43317083+vaxerski@users.noreply.github.com>2025-09-28 23:20:52 +0200
commitb627885788acbab4c768632f800e010467ffbaf9 (patch)
tree324a95da529af3e28efaa9f2ef95df353b66296f /src/desktop/Window.cpp
parentc30036bdacbe5e87b49d6de6df652d56681ef457 (diff)
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.
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp10
1 files changed, 5 insertions, 5 deletions
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() {