From 19f9f1b04fc218f2a2d15e0e3015bae308a26197 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 14 May 2015 10:47:29 -0400 Subject: A couple adjustments to the session startup procedures: 1) Ensure that numlockx is actually installed before running that check/enable routine. 2) Add a 250ms delay (non-blocking) between auto-started applications. This just helps prevent overloading the system and is a bit nicer about starting a lot of processes in a short time frame. --- lumina-desktop/LSession.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index be144c04..e1eac520 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -213,10 +213,13 @@ void LSession::launchStartupApps(){ //First start any system-defined startups, then do user defined qDebug() << "Launching startup applications"; - //Enable Numlock - if(sessionsettings->value("EnableNumlock",false).toBool()){ - QProcess::startDetached("numlockx on"); + //Enable Numlock + if(LUtils::isValidBinary("numlockx")){ //make sure numlockx is installed + if(sessionsettings->value("EnableNumlock",false).toBool()){ + QProcess::startDetached("numlockx on"); + } } + //First create the list of all possible locations in order of precedence // NOTE: Lumina/system defaults should be launched earlier due to possible system admin utilities /*QStringList filelist; @@ -257,7 +260,12 @@ void LSession::launchStartupApps(){ //Don't update the mouse cursor QProcess::startDetached("lumina-open \""+xdgapps[i].filePath+"\""); } - LSession::processEvents(); + //Put a tiny bit of space between app starts (don't overload the system) + for(int i=0; i<5; i++){ + usleep(50000); //50ms = 50000 us --> 250ms total wait + LSession::processEvents(); + } + } //Re-load the screen brightness and volume settings from the previous session -- cgit