From 3f9e6a1de6bcc9b35f88c0216cb7d50d0241b119 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 21 Sep 2017 15:10:03 -0400 Subject: Fix up the loading of the theme settings before the session is started in Lumina 1, and also fix the pkg plist so it includes the qss files. --- src-qt5/core/lumina-desktop/LSession.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 2a1ec783..44f657c0 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -387,11 +387,12 @@ void LSession::checkWindowGeoms(){ void LSession::checkUserFiles(){ //internal version conversion examples: // [1.0.0 -> 1000000], [1.2.3 -> 1002003], [0.6.1 -> 6001] - QString OVS = sessionsettings->value("DesktopVersion","0").toString(); //Old Version String + QSettings sset("lumina-desktop", "sessionsettings"); + QString OVS = sset.value("DesktopVersion","0").toString(); //Old Version String bool changed = LDesktopUtils::checkUserFiles(OVS); if(changed){ //Save the current version of the session to the settings file (for next time) - sessionsettings->setValue("DesktopVersion", this->applicationVersion()); + sset.setValue("DesktopVersion", LDesktopUtils::LuminaDesktopVersion()); } } -- cgit From 56d7717d8181974dc3c5cb35eb2436668bf2c6ce Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 21 Sep 2017 15:13:36 -0400 Subject: Make sure we don't run the checkUserFiles() function a second time --- src-qt5/core/lumina-desktop/LSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 44f657c0..feb3c95c 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -120,7 +120,7 @@ void LSession::setupSession(){ //Setup the user's lumina settings directory as necessary splash.showScreen("user"); if(DEBUG){ qDebug() << " - Init User Files:" << timer->elapsed();} - checkUserFiles(); //adds these files to the watcher as well + //checkUserFiles(); //adds these files to the watcher as well //Initialize the internal variables DESKTOPS.clear(); -- cgit From ca75f41432756e1a2796c046787474514277012e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 21 Sep 2017 15:23:09 -0400 Subject: Oops - need to make sure that status function does not access any global QApplication instance. --- src-qt5/core/lumina-desktop/LSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index feb3c95c..99b20194 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -389,7 +389,7 @@ void LSession::checkUserFiles(){ // [1.0.0 -> 1000000], [1.2.3 -> 1002003], [0.6.1 -> 6001] QSettings sset("lumina-desktop", "sessionsettings"); QString OVS = sset.value("DesktopVersion","0").toString(); //Old Version String - bool changed = LDesktopUtils::checkUserFiles(OVS); + bool changed = LDesktopUtils::checkUserFiles(OVS, LDesktopUtils::LuminaDesktopVersion()); if(changed){ //Save the current version of the session to the settings file (for next time) sset.setValue("DesktopVersion", LDesktopUtils::LuminaDesktopVersion()); -- cgit From bf91a7abadbb6b285dc955393633325928903bf6 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 21 Sep 2017 16:13:28 -0400 Subject: Urg - more fixes... --- src-qt5/core/lumina-desktop/LSession.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 99b20194..d1d6588e 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -389,6 +389,9 @@ void LSession::checkUserFiles(){ // [1.0.0 -> 1000000], [1.2.3 -> 1002003], [0.6.1 -> 6001] QSettings sset("lumina-desktop", "sessionsettings"); QString OVS = sset.value("DesktopVersion","0").toString(); //Old Version String + char *tmp; + int tmpN = 0; + QApplication A(tmpN, &tmp); bool changed = LDesktopUtils::checkUserFiles(OVS, LDesktopUtils::LuminaDesktopVersion()); if(changed){ //Save the current version of the session to the settings file (for next time) -- cgit From 7c986120915920c18a85397cd81c73df65a1eafb Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 6 Oct 2017 09:23:11 -0400 Subject: Try to ensure that the transient QApplication for user file checks/updates is completely deleted. --- src-qt5/core/lumina-desktop/LSession.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index d1d6588e..0acd7303 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -391,12 +391,13 @@ void LSession::checkUserFiles(){ QString OVS = sset.value("DesktopVersion","0").toString(); //Old Version String char *tmp; int tmpN = 0; - QApplication A(tmpN, &tmp); + QApplication *A = new QApplication(tmpN, &tmp); bool changed = LDesktopUtils::checkUserFiles(OVS, LDesktopUtils::LuminaDesktopVersion()); if(changed){ //Save the current version of the session to the settings file (for next time) sset.setValue("DesktopVersion", LDesktopUtils::LuminaDesktopVersion()); } + delete A; } void LSession::refreshWindowManager(){ -- cgit From e152255ec8e2bb7c0604fbbe569d47f345678ea6 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 16 Oct 2017 11:54:07 -0400 Subject: Clean up the session file-init routine. Now the user files are scanned/created from within the start-lumina-desktop process, not the desktop process. This fixes the loading of the theme engine for the desktop process on first-run situations, and also ensures that the desktop process does not need to make any major changes to it's configs while it is still running. --- src-qt5/core/lumina-desktop/LSession.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 0acd7303..fb24117d 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -384,20 +384,26 @@ void LSession::checkWindowGeoms(){ } } -void LSession::checkUserFiles(){ +bool LSession::checkUserFiles(){ //internal version conversion examples: // [1.0.0 -> 1000000], [1.2.3 -> 1002003], [0.6.1 -> 6001] + qDebug() << "Check User Files"; + //char tmp[] = "junk\0"; + //int tmpN = 0; + //QApplication A(tmpN, (char **)&tmp); QSettings sset("lumina-desktop", "sessionsettings"); QString OVS = sset.value("DesktopVersion","0").toString(); //Old Version String - char *tmp; - int tmpN = 0; - QApplication *A = new QApplication(tmpN, &tmp); + 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()); } - delete A; + qDebug() << "Finished with user files check"; + //delete A; + return changed; } void LSession::refreshWindowManager(){ -- cgit From ffa97c5088b2dc88ca38044774813549468969ea Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 25 Oct 2017 15:42:46 -0400 Subject: Speed up some of the desktop init procedures again. Got the "init" time from ~4.2 seconds to ~0.6 seconds on my laptop. --- src-qt5/core/lumina-desktop/LSession.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index fb24117d..6fceff1b 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -98,7 +98,7 @@ void LSession::setupSession(){ qDebug() << "Initializing Session"; if(QFile::exists("/tmp/.luminastopping")){ QFile::remove("/tmp/.luminastopping"); } QTime* timer = 0; - //if(DEBUG){ timer = new QTime(); timer->start(); qDebug() << " - Init srand:" << timer->elapsed();} + if(DEBUG){ timer = new QTime(); timer->start(); qDebug() << " - Init srand:" << timer->elapsed();} //Setup the QSettings default paths splash.showScreen("settings"); @@ -118,8 +118,8 @@ void LSession::setupSession(){ } //use the system settings //Setup the user's lumina settings directory as necessary - splash.showScreen("user"); - if(DEBUG){ qDebug() << " - Init User Files:" << timer->elapsed();} + //splash.showScreen("user"); + //if(DEBUG){ qDebug() << " - Init User Files:" << timer->elapsed();} //checkUserFiles(); //adds these files to the watcher as well //Initialize the internal variables @@ -147,11 +147,12 @@ void LSession::setupSession(){ if(DEBUG){ qDebug() << " - Init Desktops:" << timer->elapsed();} desktopFiles = QDir(QDir::homePath()+"/Desktop").entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs, QDir::Name | QDir::IgnoreCase | QDir::DirsFirst); updateDesktops(); - for(int i=0; i<6; i++){ LSession::processEvents(); } //Run through this a few times so the interface systems get up and running + //if(DEBUG){ qDebug() << " - Process Events (6x):" << timer->elapsed();} + //for(int i=0; i<6; i++){ LSession::processEvents(); } //Run through this a few times so the interface systems get up and running //Now setup the system watcher for changes splash.showScreen("final"); - qDebug() << " - Initialize file system watcher"; + //qDebug() << " - Initialize file system watcher"; if(DEBUG){ qDebug() << " - Init QFileSystemWatcher:" << timer->elapsed();} watcher = new QFileSystemWatcher(this); QString confdir = sessionsettings->fileName().section("/",0,-2); @@ -171,14 +172,18 @@ void LSession::setupSession(){ connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherChange(QString)) ); connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) ); connect(this, SIGNAL(aboutToQuit()), this, SLOT(SessionEnding()) ); - if(DEBUG){ qDebug() << " - Init Finished:" << timer->elapsed(); delete timer;} - for(int i=0; i<4; i++){ LSession::processEvents(); } //Again, just a few event loops here so thing can settle before we close the splash screen + //if(DEBUG){ qDebug() << " - Process Events (4x):" << timer->elapsed();} + //for(int i=0; i<4; i++){ LSession::processEvents(); } //Again, just a few event loops here so thing can settle before we close the splash screen + if(DEBUG){ qDebug() << " - Launch Startup Apps:" << timer->elapsed();} //launchStartupApps(); QTimer::singleShot(500, this, SLOT(launchStartupApps()) ); - splash.hide(); - LSession::processEvents(); + //if(DEBUG){ qDebug() << " - Hide Splashscreen:" << timer->elapsed();} + //splash.hide(); + //LSession::processEvents(); + if(DEBUG){ qDebug() << " - Close Splashscreen:" << timer->elapsed();} splash.close(); - LSession::processEvents(); + //LSession::processEvents(); + if(DEBUG){ qDebug() << " - Init Finished:" << timer->elapsed(); delete timer;} } void LSession::CleanupSession(){ @@ -303,7 +308,7 @@ void LSession::launchStartupApps(){ QString sfile = sessionsettings->value("audiofiles/login", LOS::LuminaShare()+"Login.ogg").toString(); playAudioFile(sfile); } - qDebug() << "[DESKTOP INIT FINISHED]"; + //qDebug() << "[DESKTOP INIT FINISHED]"; } void LSession::StartLogout(){ -- cgit From 91134ecb1e450464acf6e9b99b17fdec26452d76 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 31 Oct 2017 09:55:21 -0400 Subject: Ensure the mouse cursor "busy" icon is used for 3 seconds when launching an external process. --- src-qt5/core/lumina-desktop/LSession.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src-qt5/core/lumina-desktop/LSession.cpp') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 6fceff1b..dab30f01 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -294,7 +294,7 @@ void LSession::launchStartupApps(){ qDebug() << " - - Screen Brightness:" << QString::number(tmp)+"%"; } //QProcess::startDetached("nice lumina-open -autostart-apps"); - ExternalProcess::launch("nice lumina-open -autostart-apps"); + ExternalProcess::launch("lumina-open", QStringList() << "-autostart-apps", false); //Re-load the screen brightness and volume settings from the previous session // Wait until after the XDG-autostart functions, since the audio system might be started that way @@ -589,7 +589,7 @@ void LSession::SessionEnding(){ //=============== void LSession::LaunchApplication(QString cmd){ //LSession::setOverrideCursor(QCursor(Qt::BusyCursor)); - ExternalProcess::launch(cmd); + ExternalProcess::launch(cmd, QStringList(), true); //QProcess::startDetached(cmd); } @@ -690,7 +690,7 @@ void LSession::WindowPropertyEvent(){ if(RunningApps.length() < newapps.length()){ //New Window found //qDebug() << "New window found"; - LSession::restoreOverrideCursor(); //restore the mouse cursor back to normal (new window opened?) + //LSession::restoreOverrideCursor(); //restore the mouse cursor back to normal (new window opened?) //Perform sanity checks on any new window geometries for(int i=0; i