summaryrefslogtreecommitdiff
path: root/src/desktop/view/LayerSurface.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-12-31 18:13:42 +0100
committerGitHub <noreply@github.com>2025-12-31 18:13:42 +0100
commitbd02178e9642c0b791ecf443014d7b6d05b82b6d (patch)
tree1a44c098fa2bd0d6ed532efeb3f74ed98c31b4a4 /src/desktop/view/LayerSurface.cpp
parent214fdb099ca84435196a0f06c816835514c3e8e3 (diff)
desktop/LS: avoid creating an invalid LS if no monitor could be found (#12787)
Diffstat (limited to 'src/desktop/view/LayerSurface.cpp')
-rw-r--r--src/desktop/view/LayerSurface.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/desktop/view/LayerSurface.cpp b/src/desktop/view/LayerSurface.cpp
index f61d9554..2d863225 100644
--- a/src/desktop/view/LayerSurface.cpp
+++ b/src/desktop/view/LayerSurface.cpp
@@ -23,24 +23,11 @@ PHLLS CLayerSurface::create(SP<CLayerShellResource> resource) {
pLS->m_wlSurface->assign(resource->m_surface.lock(), pLS);
- if (!pMonitor) {
- Log::logger->log(Log::ERR, "New LS has no monitor??");
- return pLS;
- }
-
- if (pMonitor->m_mirrorOf)
- pMonitor = g_pCompositor->m_monitors.front();
-
- pLS->m_self = pLS;
-
- pLS->m_namespace = resource->m_layerNamespace;
-
- pLS->m_layer = resource->m_current.layer;
- pLS->m_popupHead = CPopup::create(pLS);
- pLS->m_monitor = pMonitor;
- pMonitor->m_layerSurfaceLayers[resource->m_current.layer].emplace_back(pLS);
-
pLS->m_ruleApplicator = makeUnique<Desktop::Rule::CLayerRuleApplicator>(pLS);
+ pLS->m_self = pLS;
+ pLS->m_namespace = resource->m_layerNamespace;
+ pLS->m_layer = resource->m_current.layer;
+ pLS->m_popupHead = CPopup::create(pLS);
g_pAnimationManager->createAnimation(0.f, pLS->m_alpha, g_pConfigManager->getAnimationPropertyConfig("fadeLayersIn"), pLS, AVARDAMAGE_ENTIRE);
g_pAnimationManager->createAnimation(Vector2D(0, 0), pLS->m_realPosition, g_pConfigManager->getAnimationPropertyConfig("layersIn"), pLS, AVARDAMAGE_ENTIRE);
@@ -50,6 +37,19 @@ PHLLS CLayerSurface::create(SP<CLayerShellResource> resource) {
pLS->m_alpha->setValueAndWarp(0.f);
+ if (!pMonitor) {
+ Log::logger->log(Log::DEBUG, "LayerSurface {:x} (namespace {} layer {}) created on NO MONITOR ?!", rc<uintptr_t>(resource.get()), resource->m_layerNamespace,
+ sc<int>(pLS->m_layer));
+
+ return pLS;
+ }
+
+ if (pMonitor->m_mirrorOf)
+ pMonitor = g_pCompositor->m_monitors.front();
+
+ pLS->m_monitor = pMonitor;
+ pMonitor->m_layerSurfaceLayers[resource->m_current.layer].emplace_back(pLS);
+
Log::logger->log(Log::DEBUG, "LayerSurface {:x} (namespace {} layer {}) created on monitor {}", rc<uintptr_t>(resource.get()), resource->m_layerNamespace,
sc<int>(pLS->m_layer), pMonitor->m_name);