From b8ec11e213bb3021e348d53a07554511342b4482 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 26 Sep 2016 11:28:27 -0400 Subject: Add auto-detection of GPU acceleration to the start-lumina-desktop utility if compton is used, and automatically adjust the compton settings to use GPU accelleration or not. (Requires "glxinfo" utility installed). --- src-qt5/core/lumina-session/session.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 5f9ca6c4..0e88a227 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -95,7 +95,7 @@ void LSession::start(){ //Compositing manager QSettings settings("lumina-desktop","sessionsettings"); if(settings.value("enableCompositing",true).toBool()){ - if(LUtils::isValidBinary("compton")){ + if(LUtils::isValidBinary("compton")){ QString set = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/compton.conf"; if(!QFile::exists(set)){ if(QFile::exists(LOS::LuminaShare()+"/compton.conf")){ @@ -106,6 +106,16 @@ void LSession::start(){ qDebug() << "Using default compton settings"; startProcess("compositing","compton"); }else{ + //Auto-detect if GLX is available on the system and turn it on/off as needed + if(LUtils::isValidBinary("glxinfo")){ + 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 Date: Thu, 29 Sep 2016 16:15:59 -0400 Subject: Add a session option to disable compositing if no GPU acceleration is detected sessionsettings.conf: "compositingWithGpuAccelOnly": (false by default) --- src-qt5/core/lumina-session/session.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 0e88a227..5b0d7980 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -107,6 +107,7 @@ void LSession::start(){ startProcess("compositing","compton"); }else{ //Auto-detect if GLX is available on the system and turn it on/off as needed + bool startcompton = true; if(LUtils::isValidBinary("glxinfo")){ bool hasAccel =! LUtils::getCmdOutput("glxinfo -B").filter("direct rendering:").filter("Yes").isEmpty(); qDebug() << "Detected GPU Acceleration:" << hasAccel; @@ -115,10 +116,11 @@ void LSession::start(){ if(info[i].section("=",0,0).simplified()=="backend"){ info[i] = QString("backend = \"")+ (hasAccel ? "glx" : "xrender")+"\""; break; } //replace this line } LUtils::writeFile(set, info, true); + if( !hasAccel && settings.value("compositingWithGpuAccelOnly",false).toBool() ){ startcompton = false; } } - startProcess("compositing","compton --config \""+set+"\"", QStringList() << set); + if(startcompton){ startProcess("compositing","compton --config \""+set+"\"", QStringList() << set); } } - }else if(LUtils::isValidBinary("xcompmgr")){ startProcess("compositing","xcompmgr"); } + }else if(LUtils::isValidBinary("xcompmgr") && !settings.value("compositingWithGpuAccelOnly",false).toBool() ){ startProcess("compositing","xcompmgr"); } } //Desktop Next startProcess("runtime","lumina-desktop"); -- cgit From 70611ebc270d9ab05c99b507104bec503090792f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 30 Sep 2016 13:15:25 -0400 Subject: Adjust the default settings for the new GPU accel detection routine to prefer no compositing if GPU accel is not available. --- src-qt5/core/lumina-session/session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 5b0d7980..937f05d0 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -116,11 +116,11 @@ void LSession::start(){ if(info[i].section("=",0,0).simplified()=="backend"){ info[i] = QString("backend = \"")+ (hasAccel ? "glx" : "xrender")+"\""; break; } //replace this line } LUtils::writeFile(set, info, true); - if( !hasAccel && settings.value("compositingWithGpuAccelOnly",false).toBool() ){ startcompton = false; } + if( !hasAccel && settings.value("compositingWithGpuAccelOnly",true).toBool() ){ startcompton = false; } } if(startcompton){ startProcess("compositing","compton --config \""+set+"\"", QStringList() << set); } } - }else if(LUtils::isValidBinary("xcompmgr") && !settings.value("compositingWithGpuAccelOnly",false).toBool() ){ startProcess("compositing","xcompmgr"); } + }else if(LUtils::isValidBinary("xcompmgr") && !settings.value("compositingWithGpuAccelOnly",true).toBool() ){ startProcess("compositing","xcompmgr"); } } //Desktop Next startProcess("runtime","lumina-desktop"); -- cgit From e87ef3b22057ab391dc051c20667ba5d69888723 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 5 Oct 2016 07:12:23 -0400 Subject: Add a couple more fixes/bypasses to the start-lumina-desktop routine. 1) Make sure when re-calling with xinit, that the full path of the binary is used 2) When starting the desktop, try to detect/launch a temporary dbus session so that Qt can function properly without crashing. --- src-qt5/core/lumina-session/session.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 937f05d0..20c55ec4 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -11,6 +11,8 @@ #include #include #include +#include + #include #include @@ -56,6 +58,13 @@ void LSession::startProcess(QString ID, QString command, QStringList watchfiles) proc->setProcessChannelMode(QProcess::MergedChannels); proc->setProcessEnvironment( QProcessEnvironment::systemEnvironment() ); proc->setStandardOutputFile(logfile); + if(ID=="runtime"){ + //Bypass for a hidden dbus requirement for Qt itself (Qt 5.5.1) + QDir tmp = QDir::temp(); + if( tmp.entryList(QStringList() << "dbus-*").isEmpty() && LUtils::isValidBinary("dbus-launch")){ + command.prepend("dbus-launch --exit-with-session "); + } + } proc->start(command, QIODevice::ReadOnly); connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(procFinished()) ); PROCS << proc; -- cgit From 1da456302b2fab1fdaab989abd51b11ed23f9a2a Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 11 Oct 2016 07:40:31 -0400 Subject: Fix up the logout bug in Lumina after some changes to the startup routine. --- src-qt5/core/lumina-session/session.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 20c55ec4..2647e58d 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -36,7 +36,8 @@ void LSession::procFinished(){ stopped++; if(!stopping){ //See if this process is the main desktop binary - if(PROCS[i]->program().section("/",-1) == "lumina-desktop"){ stopall(); } //start closing down everything + 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; } @@ -58,6 +59,7 @@ void LSession::startProcess(QString ID, QString command, QStringList watchfiles) proc->setProcessChannelMode(QProcess::MergedChannels); proc->setProcessEnvironment( QProcessEnvironment::systemEnvironment() ); proc->setStandardOutputFile(logfile); + proc->setObjectName(ID); if(ID=="runtime"){ //Bypass for a hidden dbus requirement for Qt itself (Qt 5.5.1) QDir tmp = QDir::temp(); -- cgit From ded6e4e13a6a98c3793f73cbb286fcc73caf5bf7 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 18 Oct 2016 10:40:01 -0400 Subject: Large update/refactor of desktop widgets. This reduces the number of widgets in the stack by 1, and seems to help performance a bit. --- src-qt5/core/lumina-session/session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 2647e58d..c689c9a3 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -25,7 +25,7 @@ void LSession::stopall(){ for(int i=0; istate()!=QProcess::NotRunning){ PROCS[i]->terminate(); } } - //QCoreApplication::exit(0); + QCoreApplication::exit(0); } void LSession::procFinished(){ -- cgit From 7ab900e41f5f15adccd573d459a80fe60cf6a044 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 7 Nov 2016 13:52:20 -0500 Subject: LARGE UPDATE: 1) Dismantle the Lumina library completely. 2) Setup lots of small subproject files (.pri) for the individual classes within the old library. 3) Move all the Lumina binaries to use the new subproject files 4) Split up the LuminaUtils class/files into LUtils and LDesktopUtils (generic utilities, and desktop-specific utilities) --- src-qt5/core/lumina-session/session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index c689c9a3..10953f12 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include void LSession::stopall(){ -- cgit From a78098bec6289f4d242bc132205866dbdd73eb24 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 1 Dec 2016 15:40:59 -0500 Subject: Adjust the Qt-crash workaround a bit to try and avoid starting a dbus session if possible. --- src-qt5/core/lumina-session/session.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src-qt5/core/lumina-session/session.cpp') diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 10953f12..19acdb1c 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -61,11 +61,16 @@ void LSession::startProcess(QString ID, QString command, QStringList watchfiles) proc->setStandardOutputFile(logfile); proc->setObjectName(ID); if(ID=="runtime"){ - //Bypass for a hidden dbus requirement for Qt itself (Qt 5.5.1) - QDir tmp = QDir::temp(); - if( tmp.entryList(QStringList() << "dbus-*").isEmpty() && LUtils::isValidBinary("dbus-launch")){ - command.prepend("dbus-launch --exit-with-session "); - } + //Bypass for a hidden dbus file requirement for Qt itself (Qt 5.5.1+?) + 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{ + //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."; + } + } } proc->start(command, QIODevice::ReadOnly); connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(procFinished()) ); -- cgit