aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-session
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-session')
-rw-r--r--src-qt5/core/lumina-session/main.cpp20
-rw-r--r--src-qt5/core/lumina-session/session.cpp26
-rw-r--r--src-qt5/core/lumina-session/session.h2
3 files changed, 36 insertions, 12 deletions
diff --git a/src-qt5/core/lumina-session/main.cpp b/src-qt5/core/lumina-session/main.cpp
index 71244a8b..3b71bdca 100644
--- a/src-qt5/core/lumina-session/main.cpp
+++ b/src-qt5/core/lumina-session/main.cpp
@@ -55,14 +55,6 @@ int main(int argc, char ** argv)
return QProcess::execute("xinit", args);
}
qDebug() << "Starting the Lumina desktop on current X11 session:" << disp;
- //Setup any initialization values
- LTHEME::LoadCustomEnvSettings();
- LXDG::setEnvironmentVars();
- setenv("DESKTOP_SESSION","Lumina",1);
- setenv("XDG_CURRENT_DESKTOP","Lumina",1);
- unsetenv("QT_QPA_PLATFORMTHEME"); //causes issues with Lumina themes - not many people have this by default...
- //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";
@@ -81,14 +73,22 @@ int main(int argc, char ** argv)
}
//Configure X11 monitors if needed
- if(LUtils::isValidBinary("lumina-xconfig")){
+ if(LUtils::isValidBinary("lumina-xconfig")){
qDebug() << " - Resetting monitor configuration to last-used settings";
QProcess::execute("lumina-xconfig --reset-monitors");
}
qDebug() << " - Starting the session...";
+ //Setup any initialization values
+ LTHEME::LoadCustomEnvSettings();
+ LXDG::setEnvironmentVars();
+ setenv("DESKTOP_SESSION","Lumina",1);
+ setenv("XDG_CURRENT_DESKTOP","Lumina",1);
+ unsetenv("QT_QPA_PLATFORMTHEME"); //causes issues with Lumina themes - not many people have this by default...
//Startup the session
- QCoreApplication a(argc, argv);
+ QApplication a(argc, argv);
+ setenv("QP_QPA_PLATFORMTHEME","lthemeengine",1); //make sure this is after the QApplication - not actually using the theme plugin for **this** process
LSession sess;
+ sess.checkFiles(); //Make sure user files are created/installed first
sess.start(unified);
int retCode = a.exec();
qDebug() << "Finished Closing Down Lumina";
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp
index 3fdf9e66..743fc396 100644
--- a/src-qt5/core/lumina-session/session.cpp
+++ b/src-qt5/core/lumina-session/session.cpp
@@ -15,6 +15,7 @@
#include <LUtils.h>
#include <LuminaOS.h>
+#include <LDesktopUtils.h>
void LSession::stopall(){
stopping = true;
@@ -38,8 +39,12 @@ void LSession::procFinished(){
stopped++;
if(!stopping){
//See if this process is the main desktop binary
- if(PROCS[i]->objectName()=="runtime"){ stopall(); }
- else if(PROCS[i]->objectName()=="wm" && wmfails<2){ wmfails++; PROCS[i]->start(QIODevice::ReadOnly); wmTimer->start(); } //restart the WM
+ if(PROCS[i]->objectName()=="runtime"){
+ qDebug() << "Got Desktop Process Finished:" << PROCS[i]->exitCode();
+ //if(PROCS[i]->exitCode()==787){ PROCS[i]->start(QIODevice::ReadOnly); } //special internal restart code
+ //else{
+ stopall(); //}
+ }else if(PROCS[i]->objectName()=="wm" && wmfails<2){ wmfails++; PROCS[i]->start(QIODevice::ReadOnly); wmTimer->start(); } //restart the WM
//if(PROCS[i]->program().section("/",-1) == "lumina-desktop"){ stopall(); } //start closing down everything
//else{ PROCS[i]->start(QIODevice::ReadOnly); } //restart the process
//break;
@@ -164,3 +169,20 @@ void LSession::start(bool unified){
startProcess("runtime","lumina-desktop-unified");
}
}
+
+void LSession::checkFiles(){
+//internal version conversion examples:
+ // [1.0.0 -> 1000000], [1.2.3 -> 1002003], [0.6.1 -> 6001]
+ qDebug() << "[Lumina] Checking User Files";
+ QSettings sset("lumina-desktop", "sessionsettings");
+ QString OVS = sset.value("DesktopVersion","0").toString(); //Old Version String
+ qDebug() << " - Old Version:" << OVS;
+ qDebug() << " - Current Version:" << LDesktopUtils::LuminaDesktopVersion();
+ bool changed = LDesktopUtils::checkUserFiles(OVS, LDesktopUtils::LuminaDesktopVersion());
+ qDebug() << " - Made Changes:" << changed;
+ if(changed){
+ //Save the current version of the session to the settings file (for next time)
+ sset.setValue("DesktopVersion", LDesktopUtils::LuminaDesktopVersion());
+ }
+ qDebug() << "Finished with user files check";
+}
diff --git a/src-qt5/core/lumina-session/session.h b/src-qt5/core/lumina-session/session.h
index 5cf1ccfa..3bbcbb8e 100644
--- a/src-qt5/core/lumina-session/session.h
+++ b/src-qt5/core/lumina-session/session.h
@@ -83,4 +83,6 @@ public:
void start(bool unified = false);
+ void checkFiles();
+
};
bgstack15