aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-session/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-session/main.cpp')
-rw-r--r--src-qt5/core/lumina-session/main.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-session/main.cpp b/src-qt5/core/lumina-session/main.cpp
index 5fa2bb69..0e076ac3 100644
--- a/src-qt5/core/lumina-session/main.cpp
+++ b/src-qt5/core/lumina-session/main.cpp
@@ -8,6 +8,8 @@
#include <QCoreApplication>
#include <QProcess>
#include <QString>
+#include <QLockFile>
+#include <QX11Info>
#include "session.h"
#include <LUtils.h>
@@ -16,6 +18,8 @@
#include <LuminaThemes.h>
#include <LuminaXDG.h>
+#include <unistd.h>
+
#define DEBUG 0
int main(int argc, char ** argv)
@@ -51,6 +55,19 @@ int main(int argc, char ** argv)
//Check for any missing user config files
+ //Check for any stale desktop lock files and clean them up
+ QString cfile = QDir::tempPath()+"/.LSingleApp-%1-%2-%3";
+ cfile = cfile.arg( QString(getlogin()), "lumina-desktop", QString::number(QX11Info::appScreen()) );
+ if(QFile::exists(cfile)){
+ qDebug() << "Found Desktop Lock for X session:" << disp;
+ qDebug() << " - Disabling Lock and starting new desktop session";
+ QLockFile lock(cfile+"-lock");
+ if(lock.isLocked()){ lock.unlock(); }
+ QFile::remove(cfile);
+ }
+ if(QFile::exists(QDir::tempPath()+"/.luminastopping")){
+ QFile::remove(QDir::tempPath()+"/.luminastopping");
+ }
//Configure X11 monitors if needed
if(LUtils::isValidBinary("lumina-xconfig")){
bgstack15