From 0a28e13787a83a48cbca9641a02b8ea4857c733c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 26 Jan 2025 12:54:32 +0000 Subject: desktop: move desktop types to memory-safe pointers --- src/desktop/LayerSurface.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/desktop/LayerSurface.cpp') diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index dd30aa7c..c2b07c5d 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -31,9 +31,10 @@ PHLLS CLayerSurface::create(SP resource) { pLS->szNamespace = resource->layerNamespace; - pLS->layer = resource->current.layer; - pLS->popupHead = makeUnique(pLS); - pLS->monitor = pMonitor; + pLS->layer = resource->current.layer; + pLS->popupHead = makeUnique(pLS); + pLS->popupHead->m_pSelf = pLS->popupHead; + pLS->monitor = pMonitor; pMonitor->m_aLayerSurfaceLayers[resource->current.layer].emplace_back(pLS); pLS->forceBlur = g_pConfigManager->shouldBlurLS(pLS->szNamespace); @@ -331,7 +332,7 @@ void CLayerSurface::onCommit() { nullptr); if (!WASLASTFOCUS && popupHead) { popupHead->breadthfirst( - [&WASLASTFOCUS](CPopup* popup, void* data) { + [&WASLASTFOCUS](WP popup, void* data) { WASLASTFOCUS = WASLASTFOCUS || (popup->m_pWLSurface && g_pSeatManager->state.keyboardFocus == popup->m_pWLSurface->resource()); }, nullptr); @@ -576,7 +577,7 @@ int CLayerSurface::popupsCount() { return 0; int no = -1; // we have one dummy - popupHead->breadthfirst([](CPopup* p, void* data) { *(int*)data += 1; }, &no); + popupHead->breadthfirst([](WP p, void* data) { *(int*)data += 1; }, &no); return no; } -- cgit v1.2.3