aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/lumina-session/lumina-session.pro2
-rw-r--r--src-qt5/core/lumina-session/main.cpp17
2 files changed, 18 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-session/lumina-session.pro b/src-qt5/core/lumina-session/lumina-session.pro
index dc697a34..4b06ad60 100644
--- a/src-qt5/core/lumina-session/lumina-session.pro
+++ b/src-qt5/core/lumina-session/lumina-session.pro
@@ -1,6 +1,6 @@
include($${PWD}/../../OS-detect.pri)
-QT = core widgets
+QT = core widgets x11extras
TARGET = start-lumina-desktop
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