summaryrefslogtreecommitdiff
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-01-26 12:54:32 +0000
committerVaxry <vaxry@vaxry.net>2025-01-26 12:54:38 +0000
commit0a28e13787a83a48cbca9641a02b8ea4857c733c (patch)
tree3bcb22dd6d477e62748727a246e97c24de524003 /src/desktop/Window.cpp
parent3cd6e3960f0cbf500786497017ff3084cc9deb17 (diff)
desktop: move desktop types to memory-safe pointers
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index b1b3c66c..9dcdb385 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -154,7 +154,7 @@ SBoxExtents CWindow::getFullWindowExtents() {
CBox surfaceExtents = {0, 0, 0, 0};
// TODO: this could be better, perhaps make a getFullWindowRegion?
m_pPopupHead->breadthfirst(
- [](CPopup* popup, void* data) {
+ [](WP<CPopup> popup, void* data) {
if (!popup->m_pWLSurface || !popup->m_pWLSurface->resource())
return;
@@ -569,8 +569,10 @@ void CWindow::onMap() {
if (m_bIsX11)
return;
- m_pSubsurfaceHead = makeUnique<CSubsurface>(m_pSelf.lock());
- m_pPopupHead = makeUnique<CPopup>(m_pSelf.lock());
+ m_pSubsurfaceHead = makeUnique<CSubsurface>(m_pSelf.lock());
+ m_pSubsurfaceHead->m_pSelf = m_pSubsurfaceHead;
+ m_pPopupHead = makeUnique<CPopup>(m_pSelf.lock());
+ m_pPopupHead->m_pSelf = m_pPopupHead;
}
void CWindow::onBorderAngleAnimEnd(WP<CBaseAnimatedVariable> pav) {
@@ -847,7 +849,7 @@ bool CWindow::hasPopupAt(const Vector2D& pos) {
if (m_bIsX11)
return false;
- CPopup* popup = m_pPopupHead->at(pos);
+ auto popup = m_pPopupHead->at(pos);
return popup && popup->m_pWLSurface->resource();
}
@@ -1289,7 +1291,7 @@ int CWindow::popupsCount() {
return 0;
int no = -1;
- m_pPopupHead->breadthfirst([](CPopup* p, void* d) { *((int*)d) += 1; }, &no);
+ m_pPopupHead->breadthfirst([](WP<CPopup> p, void* d) { *((int*)d) += 1; }, &no);
return no;
}