diff --git a/src/core/LockSurface.cpp b/src/core/LockSurface.cpp index beb522b..95ae232 100644 --- a/src/core/LockSurface.cpp +++ b/src/core/LockSurface.cpp @@ -27,6 +27,8 @@ static const wp_fractional_scale_v1_listener fsListener = { }; CSessionLockSurface::~CSessionLockSurface() { + g_pRenderer->removeWidgetsFor(this); + if (fractional) { wp_viewport_destroy(viewport); wp_fractional_scale_v1_destroy(fractional); diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 05eda53..8ea5059 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -300,11 +300,7 @@ void CHyprlock::onGlobal(void* data, struct wl_registry* registry, uint32_t name void CHyprlock::onGlobalRemoved(void* data, struct wl_registry* registry, uint32_t name) { Debug::log(LOG, " | removed iface {}", name); - auto outputIt = std::find_if(m_vOutputs.begin(), m_vOutputs.end(), [name](const auto& other) { return other->name == name; }); - if (outputIt != m_vOutputs.end()) { - g_pRenderer->removeWidgetsFor(outputIt->get()->sessionLockSurface.get()); - m_vOutputs.erase(outputIt); - } + std::erase_if(m_vOutputs, [name](const auto& other) { return other->name == name; }); } // end wl_registry