Only execute kwin_opengl_test if OpenGL/GLX is going to be used

* don't execute OpenGL test app if user selected XRender
* don't execute OpenGL test app if user forces to EGL

If a user selected XRender because OpenGL is failing badly it might not
be the best idea to call an OpenGL application.

If the user enforces EGL it's kind of pointless to call a testapp which
uses GLX.

REVIEW: 110659
This commit is contained in:
Martin Gräßlin 2013-05-27 08:52:30 +02:00
parent 2be7da70e0
commit 92bc318e45
2 changed files with 5 additions and 2 deletions

View file

@ -139,7 +139,8 @@ void CompositingPrefs::detect()
#ifndef KWIN_HAVE_OPENGLES
// HACK: This is needed for AIGLX
const bool forceIndirect = qstrcmp(qgetenv("LIBGL_ALWAYS_INDIRECT"), "1") == 0;
if (!forceIndirect && qstrcmp(qgetenv("KWIN_DIRECT_GL"), "1") != 0) {
const bool forceEgl = qstrcmp(qgetenv("KWIN_OPENGL_INTERFACE"), "egl") == 0;
if (!forceIndirect && !forceEgl && qstrcmp(qgetenv("KWIN_DIRECT_GL"), "1") != 0) {
// Start an external helper program that initializes GLX and returns
// 0 if we can use direct rendering, and 1 otherwise.
// The reason we have to use an external program is that after GLX

View file

@ -949,7 +949,9 @@ void Options::reloadCompositingSettings(bool force)
// Compositing settings
CompositingPrefs prefs;
if (compositingMode() == OpenGLCompositing) {
prefs.detect();
}
KSharedConfig::Ptr _config = KGlobal::config();
KConfigGroup config(_config, "Compositing");