aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2019-03-12 14:18:42 -0400
committerKen Moore <ken@ixsystems.com>2019-03-12 14:18:42 -0400
commit9815558a1caa65564d02a8be579fbab3477e946d (patch)
tree1adbab1daedea7ee0b00fd8e90e45f80ca549cb6
parentMake sure that the start menu is "activated" when opened so that it always ha... (diff)
downloadlumina-9815558a1caa65564d02a8be579fbab3477e946d.tar.gz
lumina-9815558a1caa65564d02a8be579fbab3477e946d.tar.bz2
lumina-9815558a1caa65564d02a8be579fbab3477e946d.zip
A couple changes for compositing:
1. Always use the glx backend for compton. xrender or hybrid causes flickering. 2. Always copy over the compton.conf and get that setup even if compton is not used. This will also check/replace a blank compton.conf file.
-rw-r--r--src-qt5/core/lumina-session/session.cpp40
1 files changed, 14 insertions, 26 deletions
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp
index 125cef20..3dcd78fc 100644
--- a/src-qt5/core/lumina-session/session.cpp
+++ b/src-qt5/core/lumina-session/session.cpp
@@ -103,36 +103,24 @@ void LSession::startProcess(QString ID, QString command, QStringList watchfiles)
}
void LSession::setupCompositor(bool force){
+ //Compton available - check the config file
+ QString set = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/compton.conf";
+ if(!QFile::exists(set) || LUtils::readFile(set).join("").simplified().isEmpty() ){
+ if(QFile::exists(LOS::LuminaShare()+"/compton.conf")){
+ QFile::copy(LOS::LuminaShare()+"/compton.conf", set);
+ }
+ }
+
//Compositing manager
QSettings settings("lumina-desktop","sessionsettings");
if(settings.value("enableCompositing",false).toBool() || force){
if(LUtils::isValidBinary("compton")){
- //Compton available - check the config file
- QString set = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/compton.conf";
- if(!QFile::exists(set)){
- if(QFile::exists(LOS::LuminaShare()+"/compton.conf")){
- QFile::copy(LOS::LuminaShare()+"/compton.conf", set);
- }
- }
- //Auto-detect if GLX is available on the system and turn it on/off as needed
- bool startcompton = true;
- bool hasAccel = false;
- if(LUtils::isValidBinary("glxinfo")){
- 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++){
- 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",true).toBool() ){ startcompton = false; }
- }
- QString disp = getenv("DISPLAY");
- // Prefer GLX-accel only if that is detected as possible
- if( (startcompton || force) && hasAccel ){ startProcess("compositing","compton --backend glx -d "+disp+" --config "+set, QStringList() << set); }
- //if cannot determine if GLX accel is available, use the hybrid glx/xrender backend for some better auto-setting stuff
- else if(startcompton || force){ startProcess("compositing","compton --backend xr_glx_hybrid -d "+disp+" --config "+set, QStringList() << set); }
- }else if(LUtils::isValidBinary("xcompmgr") && !settings.value("compositingWithGpuAccelOnly",true).toBool() ){ startProcess("compositing","xcompmgr"); }
+ QString disp = getenv("DISPLAY");
+ //Always use the GLX backend for compton - the xrender and hybrid backends cause lots of flickering
+ startProcess("compositing","compton --backend glx -d "+disp+" --config "+set, QStringList() << set);
+ }else if(LUtils::isValidBinary("xcompmgr") && !settings.value("compositingWithGpuAccelOnly",true).toBool() ){
+ startProcess("compositing","xcompmgr");
+ }
}
}
bgstack15