aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2016-12-05 12:29:34 -0500
committerKen Moore <ken@ixsystems.com>2016-12-05 12:29:34 -0500
commita66855211362b35033171bdecce13f02fe9aa3d7 (patch)
tree3cd4553e03abcc770163a2b5573c217934841969
parentAdd a bit more debugging to the start-lumina-desktop binary. (diff)
downloadlumina-a66855211362b35033171bdecce13f02fe9aa3d7.tar.gz
lumina-a66855211362b35033171bdecce13f02fe9aa3d7.tar.bz2
lumina-a66855211362b35033171bdecce13f02fe9aa3d7.zip
Have the "start-lumina-desktop" binary check for an existing lockfile and remove it before launching the desktop.
-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