Move Scripting from main to Workspace

Scripting can be started after everything else is started, there
is no reason to have it in main.cpp.
This commit is contained in:
Martin Gräßlin 2012-04-12 15:19:38 +02:00
parent 563dc7fb8e
commit 818714432f
3 changed files with 13 additions and 10 deletions

View file

@ -42,10 +42,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QMessageBox>
#include <QEvent>
#ifdef KWIN_BUILD_SCRIPTING
#include "scripting/scripting.h"
#endif
#include <kdialog.h>
#include <kstandarddirs.h>
#include <kdebug.h>
@ -525,9 +521,6 @@ KDE_EXPORT int kdemain(int argc, char * argv[])
org::kde::KSMServerInterface ksmserver("org.kde.ksmserver", "/KSMServer", QDBusConnection::sessionBus());
ksmserver.suspendStartup("kwin");
KWin::Application a;
#ifdef KWIN_BUILD_SCRIPTING
KWin::Scripting scripting;
#endif
ksmserver.resumeStartup("kwin");
KWin::SessionManager weAreIndeed;
@ -550,9 +543,6 @@ KDE_EXPORT int kdemain(int argc, char * argv[])
appname, QDBusConnectionInterface::DontQueueService);
KCmdLineArgs* sargs = KCmdLineArgs::parsedArgs();
#ifdef KWIN_BUILD_SCRIPTING
scripting.start();
#endif
return a.exec();
}

View file

@ -61,6 +61,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "overlaywindow.h"
#include <kwinglplatform.h>
#include <kwinglutils.h>
#ifdef KWIN_BUILD_SCRIPTING
#include "scripting/scripting.h"
#endif
#ifdef KWIN_BUILD_TILING
#include "tiling/tile.h"
#include "tiling/tilinglayout.h"
@ -152,6 +155,7 @@ Workspace::Workspace(bool restore)
, transButton(NULL)
, forceUnredirectCheck(true)
, m_finishingCompositing(false)
, m_scripting(NULL)
{
(void) new KWinAdaptor(this);
@ -470,6 +474,12 @@ void Workspace::init()
m_tiling->setEnabled(options->isTilingOn());
#endif
#ifdef KWIN_BUILD_SCRIPTING
m_scripting = new Scripting(this);
m_scripting->start();
#endif
// SELI TODO: This won't work with unreasonable focus policies,
// and maybe in rare cases also if the selected client doesn't
// want focus

View file

@ -86,6 +86,7 @@ class RootInfo;
class PluginMgr;
class Placement;
class Rules;
class Scripting;
class WindowRules;
class Workspace : public QObject, public KDecorationDefines
@ -896,6 +897,8 @@ private:
QTimer compositeResetTimer; // for compressing composite resets
bool m_finishingCompositing; // finishCompositing() sets this variable while shutting down
Scripting *m_scripting;
private:
friend bool performTransiencyCheck();
};