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");