From a66855211362b35033171bdecce13f02fe9aa3d7 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 5 Dec 2016 12:29:34 -0500 Subject: Have the "start-lumina-desktop" binary check for an existing lockfile and remove it before launching the desktop. --- src-qt5/core/lumina-session/lumina-session.pro | 2 +- src-qt5/core/lumina-session/main.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-session') 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 #include #include +#include +#include #include "session.h" #include @@ -16,6 +18,8 @@ #include #include +#include + #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")){ -- cgit