diff options
author | Ken Moore <ken@ixsystems.com> | 2018-09-13 10:21:16 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-09-13 10:21:16 -0400 |
commit | 3c8c8f7f30106de17cd8f866272bde8e193caf36 (patch) | |
tree | b495f94a4c7e1fe04277cfd2077938ae7dad04c9 /src-qt5/core | |
parent | Merge pull request #622 from chenliangomc/master (diff) | |
download | lumina-3c8c8f7f30106de17cd8f866272bde8e193caf36.tar.gz lumina-3c8c8f7f30106de17cd8f866272bde8e193caf36.tar.bz2 lumina-3c8c8f7f30106de17cd8f866272bde8e193caf36.zip |
Make the GLX/Hybrid usage for compton a bit smarter. Still prefer glx-only if that is detected, only use hybrid otherwise.
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/lumina-session/session.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 360f631e..125cef20 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -116,18 +116,22 @@ void LSession::setupCompositor(bool force){ } //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")){ - bool hasAccel =! LUtils::getCmdOutput("glxinfo -B").filter("direct rendering:").filter("Yes").isEmpty(); + hasAccel =! LUtils::getCmdOutput("glxinfo -B").filter("direct rendering:").filter("Yes").isEmpty(); qDebug() << "Detected GPU Acceleration:" << hasAccel; - QStringList info = LUtils::readFile(set); + /*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); + LUtils::writeFile(set, info, true);*/ if( !hasAccel && settings.value("compositingWithGpuAccelOnly",true).toBool() ){ startcompton = false; } } QString disp = getenv("DISPLAY"); - if(startcompton || force){ startProcess("compositing","compton --backend xr_glx_hybrid -d "+disp+" --config "+set, QStringList() << set); } + // 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"); } } } |