Introduce post Workspace init phase
Workspace emits a signal when the initialization finished and interested parties can connect to this signal to perform post init actions. That is everything that does not have to be performed to have a completely working Window Manager. As an example loading the scripts is moved into this post init phase. REVIEW: 104580icc-effect-5.14.5
parent
5803fa2353
commit
be55ac5c60
|
@ -252,6 +252,7 @@ KWin::Scripting::Scripting(QObject *parent)
|
||||||
QDBusConnection::sessionBus().registerObject("/Scripting", this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
QDBusConnection::sessionBus().registerObject("/Scripting", this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
||||||
QDBusConnection::sessionBus().registerService("org.kde.kwin.Scripting");
|
QDBusConnection::sessionBus().registerService("org.kde.kwin.Scripting");
|
||||||
connect(Workspace::self(), SIGNAL(configChanged()), SLOT(start()));
|
connect(Workspace::self(), SIGNAL(configChanged()), SLOT(start()));
|
||||||
|
connect(Workspace::self(), SIGNAL(workspaceInitialized()), SLOT(start()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void KWin::Scripting::start()
|
void KWin::Scripting::start()
|
||||||
|
|
|
@ -487,7 +487,6 @@ void Workspace::init()
|
||||||
|
|
||||||
#ifdef KWIN_BUILD_SCRIPTING
|
#ifdef KWIN_BUILD_SCRIPTING
|
||||||
m_scripting = new Scripting(this);
|
m_scripting = new Scripting(this);
|
||||||
m_scripting->start();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SELI TODO: This won't work with unreasonable focus policies,
|
// SELI TODO: This won't work with unreasonable focus policies,
|
||||||
|
@ -495,6 +494,9 @@ void Workspace::init()
|
||||||
// want focus
|
// want focus
|
||||||
workspaceInit = false;
|
workspaceInit = false;
|
||||||
|
|
||||||
|
// broadcast that Workspace is ready, but first process all events.
|
||||||
|
QMetaObject::invokeMethod(this, "workspaceInitialized", Qt::QueuedConnection);
|
||||||
|
|
||||||
// TODO: ungrabXServer()
|
// TODO: ungrabXServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -667,6 +667,11 @@ protected:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
Q_SCRIPTABLE void compositingToggled(bool active);
|
Q_SCRIPTABLE void compositingToggled(bool active);
|
||||||
|
/**
|
||||||
|
* Emitted after the Workspace has setup the complete initialization process.
|
||||||
|
* This can be used to connect to for performing post-workspace initialization.
|
||||||
|
**/
|
||||||
|
void workspaceInitialized();
|
||||||
|
|
||||||
//Signals required for the scripting interface
|
//Signals required for the scripting interface
|
||||||
signals:
|
signals:
|
||||||
|
|
Loading…
Reference in New Issue