aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/events/Layers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/events/Layers.cpp')
-rw-r--r--src/events/Layers.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index ad65f8fb..db237690 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -51,6 +51,7 @@ void Events::listener_newLayerSurface(wl_listener* listener, void* data) {
layerSurface->layer = WLRLAYERSURFACE->current.layer;
WLRLAYERSURFACE->data = layerSurface;
layerSurface->monitorID = PMONITOR->ID;
+ layerSurface->popupHead = std::make_unique<CPopup>(layerSurface);
layerSurface->forceBlur = g_pConfigManager->shouldBlurLS(layerSurface->szNamespace);
@@ -65,6 +66,8 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(layersurface->monitorID);
+ layersurface->popupHead.reset();
+
if (!g_pCompositor->getMonitorFromID(layersurface->monitorID))
Debug::log(WARN, "Layersurface destroyed on an invalid monitor (removed?)");
@@ -111,8 +114,6 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive;
layersurface->surface = layersurface->layerSurface->surface;
- layersurface->popupHead = std::make_unique<CPopup>(layersurface);
-
// fix if it changed its mon
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output);
@@ -184,8 +185,6 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
std::erase(g_pInputManager->m_dExclusiveLSes, layersurface);
- layersurface->popupHead.reset();
-
if (!g_pInputManager->m_dExclusiveLSes.empty())
g_pCompositor->focusSurface(g_pInputManager->m_dExclusiveLSes[0]->layerSurface->surface);