Create effects handler after letting toplevels setup compositing

Many effects use the stacking order property of the effects handler in
their constructors. This means that windows should have compositing
setup by the time effects are loaded.

After changing how binary effect plugins are loaded, i.e. not queueing
loading effects, but loading them immediately, some effects broke
because the effects handler is created before windows setup compositing.

This change attempts to fix those effects by rearranging compositor
startup code so windows setup compositing first, then create the effects
pointer.
This commit is contained in:
Vlad Zahorodnii 2021-12-14 12:20:11 +02:00
parent b26227348c
commit 991f6b458d

View file

@ -371,9 +371,6 @@ void Compositor::startupWithWorkspace()
m_state = State::On;
// Sets also the 'effects' pointer.
kwinApp()->platform()->createEffectsHandler(this, m_scene);
for (X11Client *c : Workspace::self()->clientList()) {
c->setupCompositing();
}
@ -391,6 +388,9 @@ void Compositor::startupWithWorkspace()
}
}
// Sets also the 'effects' pointer.
kwinApp()->platform()->createEffectsHandler(this, m_scene);
Q_EMIT compositingToggled(true);
if (m_releaseSelectionTimer.isActive()) {