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: 104580
This commit is contained in:
parent
5803fa2353
commit
be55ac5c60
3 changed files with 9 additions and 1 deletions
|
@ -252,6 +252,7 @@ KWin::Scripting::Scripting(QObject *parent)
|
|||
QDBusConnection::sessionBus().registerObject("/Scripting", this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
||||
QDBusConnection::sessionBus().registerService("org.kde.kwin.Scripting");
|
||||
connect(Workspace::self(), SIGNAL(configChanged()), SLOT(start()));
|
||||
connect(Workspace::self(), SIGNAL(workspaceInitialized()), SLOT(start()));
|
||||
}
|
||||
|
||||
void KWin::Scripting::start()
|
||||
|
|
|
@ -487,7 +487,6 @@ void Workspace::init()
|
|||
|
||||
#ifdef KWIN_BUILD_SCRIPTING
|
||||
m_scripting = new Scripting(this);
|
||||
m_scripting->start();
|
||||
#endif
|
||||
|
||||
// SELI TODO: This won't work with unreasonable focus policies,
|
||||
|
@ -495,6 +494,9 @@ void Workspace::init()
|
|||
// want focus
|
||||
workspaceInit = false;
|
||||
|
||||
// broadcast that Workspace is ready, but first process all events.
|
||||
QMetaObject::invokeMethod(this, "workspaceInitialized", Qt::QueuedConnection);
|
||||
|
||||
// TODO: ungrabXServer()
|
||||
}
|
||||
|
||||
|
|
|
@ -667,6 +667,11 @@ protected:
|
|||
|
||||
Q_SIGNALS:
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue