Commit 10fdf2a2 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Discard Deleted before Scene is destroyed

Summary:
Deleted has lifetime bounded to effects and scene.

We can't discard Deleted before EffectsHandler is destroyed because
effects that referenced it may call unrefWindow.

On the other hand, the fact that Deleted may outlive scene doesn't
make sense because Deleted exist purely for animation purposes and
nothing more.

This change arranges lifetime of Deleted so it's more reasonable.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18914
parent d0c9f728
......@@ -392,19 +392,18 @@ void Compositor::finish()
m_scene->removeToplevel(c);
foreach (Unmanaged * c, Workspace::self()->unmanagedList())
m_scene->removeToplevel(c);
foreach (Deleted * c, Workspace::self()->deletedList())
m_scene->removeToplevel(c);
foreach (Client * c, Workspace::self()->clientList())
c->finishCompositing();
foreach (Client * c, Workspace::self()->desktopList())
c->finishCompositing();
foreach (Unmanaged * c, Workspace::self()->unmanagedList())
c->finishCompositing();
foreach (Deleted * c, Workspace::self()->deletedList())
c->finishCompositing();
if (auto c = kwinApp()->x11Connection()) {
xcb_composite_unredirect_subwindows(c, kwinApp()->x11RootWindow(), XCB_COMPOSITE_REDIRECT_MANUAL);
}
while (!workspace()->deletedList().isEmpty()) {
workspace()->deletedList().first()->discard();
}
}
if (waylandServer()) {
foreach (ShellClient *c, waylandServer()->clients()) {
......@@ -434,9 +433,6 @@ void Compositor::finish()
i.setOpacity(static_cast< unsigned long >((*it)->opacity() * 0xffffffff));
}
}
// discard all Deleted windows (#152914)
while (!Workspace::self()->deletedList().isEmpty())
Workspace::self()->deletedList().first()->discard();
}
m_finishing = false;
emit compositingToggled(false);
......
......@@ -2430,7 +2430,12 @@ SceneOpenGLDecorationRenderer::SceneOpenGLDecorationRenderer(Decoration::Decorat
connect(this, &Renderer::renderScheduled, client->client(), static_cast<void (AbstractClient::*)(const QRect&)>(&AbstractClient::addRepaint));
}
SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer() = default;
SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer()
{
if (Scene *scene = Compositor::self()->scene()) {
scene->makeOpenGLContextCurrent();
}
}
// Rotates the given source rect 90° counter-clockwise,
// and flips it vertically
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment