From 92bc318e45fa968c85c4770014ba36594deea5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 27 May 2013 08:52:30 +0200 Subject: [PATCH] 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 --- compositingprefs.cpp | 3 ++- options.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compositingprefs.cpp b/compositingprefs.cpp index b79106c25b..87a6e91f36 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -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 diff --git a/options.cpp b/options.cpp index a2463ae352..03203ef291 100644 --- a/options.cpp +++ b/options.cpp @@ -949,7 +949,9 @@ void Options::reloadCompositingSettings(bool force) // Compositing settings CompositingPrefs prefs; - prefs.detect(); + if (compositingMode() == OpenGLCompositing) { + prefs.detect(); + } KSharedConfig::Ptr _config = KGlobal::config(); KConfigGroup config(_config, "Compositing");