diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-15 08:48:56 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-15 08:48:56 -0400 |
commit | 8bc1e376ff8760fe7fef68b48ce784636b8a02c3 (patch) | |
tree | 42474483cdf1b0e80da584001799ce06fd034761 | |
parent | Fix the sync of the line wrap with the current tab/file. (diff) | |
download | lumina-8bc1e376ff8760fe7fef68b48ce784636b8a02c3.tar.gz lumina-8bc1e376ff8760fe7fef68b48ce784636b8a02c3.tar.bz2 lumina-8bc1e376ff8760fe7fef68b48ce784636b8a02c3.zip |
Fix a quick bug in start-lumina-desktop where it would not stop properly if one of the main processes like compton was forcibly killed by the user ahead of time.
-rw-r--r-- | src-qt5/core/lumina-session/session.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 833a6152..1aa86720 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -31,19 +31,22 @@ void LSession::stopall(){ void LSession::procFinished(){ //Go through and check the status on all the procs to determine which one finished int stopped = 0; + //qDebug() << "Got Process Stopped Signal:"; for(int i=0; i<PROCS.length(); i++){ if(PROCS[i]->state()==QProcess::NotRunning){ + //qDebug() << " - Stopped:" << PROCS[i]->objectName(); stopped++; if(!stopping){ //See if this process is the main desktop binary if(PROCS[i]->objectName()=="runtime"){ stopall(); } //if(PROCS[i]->program().section("/",-1) == "lumina-desktop"){ stopall(); } //start closing down everything //else{ PROCS[i]->start(QIODevice::ReadOnly); } //restart the process - break; + //break; } } } - if(stopping && stopped==PROCS.length()){ + //qDebug() << " - Final Count:" << stopped << stopping; + if(stopping || stopped==PROCS.length()){ QCoreApplication::exit(0); } } @@ -65,7 +68,7 @@ void LSession::startProcess(QString ID, QString command, QStringList watchfiles) if(!QFile::exists("/etc/machine-id") && !QFile::exists("/var/db/dbus/machine-id")){ if(LUtils::isValidBinary("dbus-uuidgen") && LUtils::runCmd("dbus-uuidgen --ensure") ){ } //good - the UUID was created successfully else if(LUtils::isValidBinary("dbus-launch")){ command.prepend("dbus-launch --exit-with-session "); } - else{ + else{ //create a simple DBUS UUID and put it in the universal-fallback location (OS-independent) // TO-DO - root vs user level permissions issue? qDebug() << "Could not find '/etc/machine-id' or '/var/db/dbus/machine-id': Qt will most likely crash. \nPlease run 'dbus-uuidgen --ensure' with root permissions to generate this file if Lumina does not start properly."; @@ -98,13 +101,13 @@ void LSession::start(bool unified){ keys = keys.replaceInStrings("${XDG_CONFIG_HOME}", QString( getenv("XDG_CONFIG_HOME"))); LUtils::writeFile(confDir+"/fluxbox-init", keys, true); QFile::setPermissions(confDir+"/fluxbox-init", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); - } + } if(!QFile::exists(confDir+"/fluxbox-keys")){ QStringList keys = LUtils::readFile(LOS::LuminaShare()+"/fluxbox-keys"); keys = keys.replaceInStrings("${XDG_CONFIG_HOME}", QString( getenv("XDG_CONFIG_HOME"))); LUtils::writeFile(confDir+"/fluxbox-keys", keys, true); QFile::setPermissions(confDir+"/fluxbox-keys", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); - } + } // FLUXBOX BUG BYPASS: if the ~/.fluxbox dir does not exist, it will ignore the given config file if(!QFile::exists(QDir::homePath()+"/.fluxbox")){ QDir dir; dir.mkpath(QDir::homePath()+"/.fluxbox"); @@ -129,7 +132,7 @@ void LSession::start(bool unified){ bool hasAccel =! LUtils::getCmdOutput("glxinfo -B").filter("direct rendering:").filter("Yes").isEmpty(); qDebug() << "Detected GPU Acceleration:" << hasAccel; QStringList info = LUtils::readFile(set); - for(int i=0; i<info.length(); i++){ + for(int i=0; i<info.length(); i++){ if(info[i].section("=",0,0).simplified()=="backend"){ info[i] = QString("backend = \"")+ (hasAccel ? "glx" : "xrender")+"\""; break; } //replace this line } LUtils::writeFile(set, info, true); @@ -142,7 +145,7 @@ void LSession::start(bool unified){ } else { if(!LUtils::isValidBinary(WM)){ exit(1); - } + } startProcess("wm", WM); } //Desktop Next |