From 3ade20eea552c2536c02b9e0b69245ff119b9847 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 8 Nov 2021 21:48:24 +0200 Subject: [PATCH] Make Compositor responsible for syncing the GlStrictBinding flag The GlStrictBinding flag indicates whether it's okay not to re-bind the X11 pixmap to the OpenGL surface texture if the corresponding window is damaged. It doesn't really affect the SceneOpenGL, only low level backend stuff. --- src/composite.cpp | 6 ++++++ src/scenes/opengl/scene_opengl.cpp | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/composite.cpp b/src/composite.cpp index 9b6d010e89..beef915cab 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -34,6 +34,7 @@ #include "x11syncmanager.h" #include "xcbutils.h" +#include #include #include @@ -192,6 +193,11 @@ bool Compositor::attemptOpenGLCompositing() m_backend = backend.take(); m_scene = scene.take(); + // set strict binding + if (options->isGlStrictBindingFollowsDriver()) { + options->setGlStrictBinding(!GLPlatform::instance()->supports(LooseBinding)); + } + qCDebug(KWIN_CORE) << "OpenGL compositing has been successfully initialized"; return true; } diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index 2035ad0bba..1c9b4b979c 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -96,11 +96,6 @@ SceneOpenGL::SceneOpenGL(OpenGLBackend *backend, QObject *parent) glBindVertexArray(vao); } - // set strict binding - if (options->isGlStrictBindingFollowsDriver()) { - options->setGlStrictBinding(!glPlatform->supports(LooseBinding)); - } - qCDebug(KWIN_OPENGL) << "OpenGL 2 compositing successfully initialized"; }