diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 5eefe2bc852001d1dedcd8d1253062e764922562..47f28445879914ff0063617d5716f8548fea01c3 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -134,6 +134,7 @@
 #include <QFileDialog>
 #include <QMenu>
 #include <QMessageBox>
+#include <QTimer>
 #include <QWizard>
 
 /*!
@@ -247,6 +248,7 @@ struct ProjectExplorerPluginPrivate {
     KitManager *m_kitManager;
     ToolChainManager *m_toolChainManager;
     bool m_shuttingDown;
+    QStringList m_arguments;
 };
 
 ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() :
@@ -1597,10 +1599,17 @@ void ProjectExplorerPlugin::restoreSession()
     connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString)));
     connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString)));
 
-    Core::ICore::openFiles(arguments, Core::ICore::OpenFilesFlags(Core::ICore::CanContainLineNumbers | Core::ICore::SwitchMode));
+    d->m_arguments = arguments;
+    QTimer::singleShot(0, this, SLOT(restoreSession2()));
     updateActions();
 }
 
+void ProjectExplorerPlugin::restoreSession2()
+{
+    QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+    Core::ICore::openFiles(d->m_arguments, Core::ICore::OpenFilesFlags(Core::ICore::CanContainLineNumbers | Core::ICore::SwitchMode));
+}
+
 void ProjectExplorerPlugin::loadSession(const QString &session)
 {
     if (debug)
diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h
index d85c784d76a1dc981e40113fb2b87889d740297b..b8bbfee40e6a7470dc0845a2eb34fe750babba82 100644
--- a/src/plugins/projectexplorer/projectexplorer.h
+++ b/src/plugins/projectexplorer/projectexplorer.h
@@ -188,6 +188,7 @@ private slots:
 
     void determineSessionToRestoreAtStartup();
     void restoreSession();
+    void restoreSession2();
     void loadSession(const QString &session);
     void runProject();
     void runProjectWithoutDeploy();
diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp
index 75423af786982ffbe9fe438e234deb44b90318bb..a52c948f9c5efbc94d7220d410550723ed6626d8 100644
--- a/src/plugins/projectexplorer/session.cpp
+++ b/src/plugins/projectexplorer/session.cpp
@@ -880,6 +880,10 @@ bool SessionManager::loadSession(const QString &session)
         m_future.setProgressRange(0, fileList.count() + openEditorsCount + 2);
         m_future.setProgressValue(1);
 
+        // if one processEvents doesn't get the job done
+        // just use two!
+        QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+        QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
         restoreProjects(fileList);
         sessionLoadingProgress();
         restoreDependencies(reader);