Partly remove Compositor restart functionality
Summary: This removes the restart function of the Compositor class and renames the internal reinitialize function. Instead of the restart function reinitialize can be called. Reading again the settings in this case is fine, since it is done rarely. This reduces the code complexity. Test Plan: Manually on Wayland and X. 100% autotests pass. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: davidedmundson, zzag, kwin Tags: #kwin Maniphest Tasks: T11071 Differential Revision: https://phabricator.kde.org/D22225
This commit is contained in:
parent
ba6daecb4f
commit
8c047613c5
6 changed files with 8 additions and 21 deletions
|
@ -158,7 +158,7 @@ void DontCrashReinitializeCompositorTest::testReinitializeCompositor()
|
|||
QVERIFY(effect->isActive());
|
||||
|
||||
// Re-initialize the compositor, effects will be destroyed and created again.
|
||||
Compositor::self()->slotReinitialize();
|
||||
Compositor::self()->reinitialize();
|
||||
|
||||
// By this time, KWin should still be alive.
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ void GenericSceneOpenGLTest::testRestart()
|
|||
|
||||
QSignalSpy sceneCreatedSpy(KWin::Compositor::self(), &Compositor::sceneCreated);
|
||||
QVERIFY(sceneCreatedSpy.isValid());
|
||||
KWin::Compositor::self()->slotReinitialize();
|
||||
KWin::Compositor::self()->reinitialize();
|
||||
if (sceneCreatedSpy.isEmpty()) {
|
||||
QVERIFY(sceneCreatedSpy.wait());
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ void SceneQPainterTest::testCompositorRestart()
|
|||
QVERIFY(oldScene);
|
||||
QSignalSpy sceneCreatedSpy(KWin::Compositor::self(), &KWin::Compositor::sceneCreated);
|
||||
QVERIFY(sceneCreatedSpy.isValid());
|
||||
KWin::Compositor::self()->slotReinitialize();
|
||||
KWin::Compositor::self()->reinitialize();
|
||||
if (sceneCreatedSpy.isEmpty()) {
|
||||
QVERIFY(sceneCreatedSpy.wait());
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ Compositor::Compositor(QObject* workspace)
|
|||
, m_composeAtSwapCompletion(false)
|
||||
{
|
||||
qRegisterMetaType<Compositor::SuspendReason>("Compositor::SuspendReason");
|
||||
connect(&compositeResetTimer, &QTimer::timeout, this, &Compositor::restart);
|
||||
connect(&compositeResetTimer, &QTimer::timeout, this, &Compositor::reinitialize);
|
||||
connect(options, &Options::configChanged, this, &Compositor::slotConfigChanged);
|
||||
compositeResetTimer.setSingleShot(true);
|
||||
m_monotonicClock.start();
|
||||
|
@ -277,7 +277,7 @@ void Compositor::slotCompositingOptionsInitialized()
|
|||
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
|
||||
}
|
||||
|
||||
connect(m_scene, &Scene::resetCompositing, this, &Compositor::restart);
|
||||
connect(m_scene, &Scene::resetCompositing, this, &Compositor::reinitialize);
|
||||
emit sceneCreated();
|
||||
|
||||
if (Workspace::self()) {
|
||||
|
@ -503,7 +503,7 @@ void Compositor::slotConfigChanged()
|
|||
finish();
|
||||
}
|
||||
|
||||
void Compositor::slotReinitialize()
|
||||
void Compositor::reinitialize()
|
||||
{
|
||||
// Reparse config. Config options will be reloaded by setup()
|
||||
kwinApp()->config()->reparseConfiguration();
|
||||
|
@ -590,14 +590,6 @@ void Compositor::resume(Compositor::SuspendReason reason)
|
|||
setup(); // signal "toggled" is eventually emitted from within setup
|
||||
}
|
||||
|
||||
void Compositor::restart()
|
||||
{
|
||||
if (hasScene()) {
|
||||
finish();
|
||||
QTimer::singleShot(0, this, &Compositor::setup);
|
||||
}
|
||||
}
|
||||
|
||||
void Compositor::addRepaint(int x, int y, int w, int h)
|
||||
{
|
||||
if (!hasScene())
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
* Re-initializes the Compositor completely.
|
||||
* Connected to the D-Bus signal org.kde.KWin /KWin reinitCompositing
|
||||
**/
|
||||
void slotReinitialize();
|
||||
void reinitialize();
|
||||
|
||||
/**
|
||||
* Whether the Compositor is active. That is a Scene is present and the Compositor is
|
||||
|
@ -187,11 +187,6 @@ private:
|
|||
**/
|
||||
void slotCompositingOptionsInitialized();
|
||||
void finish();
|
||||
/**
|
||||
* Restarts the Compositor if running.
|
||||
* That is the Compositor will be stopped and started again.
|
||||
**/
|
||||
void restart();
|
||||
|
||||
void claimCompositorSelection();
|
||||
|
||||
|
|
|
@ -319,7 +319,7 @@ void CompositorDBusInterface::suspend()
|
|||
|
||||
void CompositorDBusInterface::reinitialize()
|
||||
{
|
||||
m_compositor->slotReinitialize();
|
||||
m_compositor->reinitialize();
|
||||
}
|
||||
|
||||
QStringList CompositorDBusInterface::supportedOpenGLPlatformInterfaces() const
|
||||
|
|
Loading…
Reference in a new issue