plugins/screentransform: Avoid mangling with opengl context when a screen is removed

For the most part, the screen transform effect is inactive. So if a
screen is removed, it's likely that m_states contains no entry for it.
This commit is contained in:
Vlad Zahorodnii 2023-11-22 09:59:42 +02:00 committed by David Edmundson
parent e894f694ce
commit bd5c566399

View file

@ -116,9 +116,10 @@ void ScreenTransformEffect::addScreen(Output *screen)
void ScreenTransformEffect::removeScreen(Output *screen)
{
effects->makeOpenGLContextCurrent();
m_states.remove(screen);
effects->doneOpenGLContextCurrent();
if (auto it = m_states.find(screen); it != m_states.end()) {
effects->makeOpenGLContextCurrent();
m_states.erase(it);
}
}
void ScreenTransformEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime)