mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-17 07:15:57 +01:00
renderer: remove widgets for destroyed lockSurfaces
This commit is contained in:
parent
8e91c4b0f9
commit
ee9d75b580
3 changed files with 11 additions and 1 deletions
|
@ -300,7 +300,11 @@ void CHyprlock::onGlobal(void* data, struct wl_registry* registry, uint32_t name
|
||||||
|
|
||||||
void CHyprlock::onGlobalRemoved(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);
|
Debug::log(LOG, " | removed iface {}", name);
|
||||||
std::erase_if(m_vOutputs, [name](const auto& other) { return other->name == 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// end wl_registry
|
// end wl_registry
|
||||||
|
|
|
@ -512,3 +512,7 @@ void CRenderer::popFb() {
|
||||||
boundFBs.pop_back();
|
boundFBs.pop_back();
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, boundFBs.empty() ? 0 : boundFBs.back());
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, boundFBs.empty() ? 0 : boundFBs.back());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CRenderer::removeWidgetsFor(const CSessionLockSurface* surf) {
|
||||||
|
widgets.erase(surf);
|
||||||
|
}
|
||||||
|
|
|
@ -41,6 +41,8 @@ class CRenderer {
|
||||||
void pushFb(GLint fb);
|
void pushFb(GLint fb);
|
||||||
void popFb();
|
void popFb();
|
||||||
|
|
||||||
|
void removeWidgetsFor(const CSessionLockSurface* surf);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
widgetMap_t widgets;
|
widgetMap_t widgets;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue