desktop: cleanup code and use std::ranges (#10289)

This commit is contained in:
s1dd 2025-05-09 00:31:49 +05:30 committed by GitHub
parent 04c98abd1f
commit f01e3043b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 57 additions and 74 deletions

View file

@ -186,7 +186,7 @@ void CLayerSurface::onMap() {
m_readyToDelete = false;
m_fadingOut = false;
g_pEventManager->postEvent(SHyprIPCEvent{"openlayer", m_namespace});
g_pEventManager->postEvent(SHyprIPCEvent{.event = "openlayer", .data = m_namespace});
EMIT_HOOK_EVENT("openLayer", m_self.lock());
g_pCompositor->setPreferredScaleForSurface(m_surface->resource(), PMONITOR->m_scale);
@ -196,7 +196,7 @@ void CLayerSurface::onMap() {
void CLayerSurface::onUnmap() {
Debug::log(LOG, "LayerSurface {:x} unmapped", (uintptr_t)m_layerSurface.get());
g_pEventManager->postEvent(SHyprIPCEvent{"closelayer", m_layerSurface->m_layerNamespace});
g_pEventManager->postEvent(SHyprIPCEvent{.event = "closelayer", .data = m_layerSurface->m_layerNamespace});
EMIT_HOOK_EVENT("closeLayer", m_self.lock());
std::erase_if(g_pInputManager->m_exclusiveLSes, [this](const auto& other) { return !other || other == m_self; });