summaryrefslogtreecommitdiff
path: root/src/desktop/LayerSurface.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/LayerSurface.cpp
parent3cd6e3960f0cbf500786497017ff3084cc9deb17 (diff)
desktop: move desktop types to memory-safe pointers
Diffstat (limited to 'src/desktop/LayerSurface.cpp')
-rw-r--r--src/desktop/LayerSurface.cpp11
1 files changed, 6 insertions, 5 deletions
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<CLayerShellResource> resource) {
pLS->szNamespace = resource->layerNamespace;
- pLS->layer = resource->current.layer;
- pLS->popupHead = makeUnique<CPopup>(pLS);
- pLS->monitor = pMonitor;
+ pLS->layer = resource->current.layer;
+ pLS->popupHead = makeUnique<CPopup>(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<CPopup> 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<CPopup> p, void* data) { *(int*)data += 1; }, &no);
return no;
}