From 350144cde66556bce00ad2608797035076914efe Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 3 Nov 2021 19:00:50 +0200 Subject: [PATCH] scenes/opengl: Remove viewport check It's unreliable and it sometimes produces false positives (due to buggy drivers). --- src/plugins/scenes/opengl/scene_opengl.cpp | 21 --------------------- src/plugins/scenes/opengl/scene_opengl.h | 1 - 2 files changed, 22 deletions(-) diff --git a/src/plugins/scenes/opengl/scene_opengl.cpp b/src/plugins/scenes/opengl/scene_opengl.cpp index 329030c66f..2ba11e08ad 100644 --- a/src/plugins/scenes/opengl/scene_opengl.cpp +++ b/src/plugins/scenes/opengl/scene_opengl.cpp @@ -75,9 +75,6 @@ SceneOpenGL::SceneOpenGL(OpenGLBackend *backend, QObject *parent) : Scene(parent) , m_backend(backend) { - if (!viewportLimitsMatched(screens()->size())) - return; - // perform Scene specific checks GLPlatform *glPlatform = GLPlatform::instance(); if (!glPlatform->isGLES() && !hasGLExtension(QByteArrayLiteral("GL_ARB_texture_non_power_of_two")) @@ -568,24 +565,6 @@ void SceneOpenGL::extendPaintRegion(QRegion ®ion, bool opaqueFullscreen) } } -bool SceneOpenGL::viewportLimitsMatched(const QSize &size) const { - if (kwinApp()->operationMode() != Application::OperationModeX11) { - // TODO: On Wayland we can't suspend. Find a solution that works here as well! - return true; - } - GLint limit[2]; - glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit); - if (limit[0] < size.width() || limit[1] < size.height()) { - auto compositor = static_cast(Compositor::self()); - QMetaObject::invokeMethod(compositor, [compositor]() { - qCDebug(KWIN_OPENGL) << "Suspending compositing because viewport limits are not met"; - compositor->suspend(X11Compositor::AllReasonSuspend); - }, Qt::QueuedConnection); - return false; - } - return true; -} - void SceneOpenGL::paintDesktop(int desktop, int mask, const QRegion ®ion, ScreenPaintData &data) { const QRect r = region.boundingRect(); diff --git a/src/plugins/scenes/opengl/scene_opengl.h b/src/plugins/scenes/opengl/scene_opengl.h index 64c846d375..d84d544b0a 100644 --- a/src/plugins/scenes/opengl/scene_opengl.h +++ b/src/plugins/scenes/opengl/scene_opengl.h @@ -79,7 +79,6 @@ protected: void paintCursor(const QRegion ®ion) override; private: - bool viewportLimitsMatched(const QSize &size) const; void doPaintBackground(const QVector< float >& vertices); void updateProjectionMatrix(const QRect &geometry); void performPaintWindow(EffectWindowImpl* w, int mask, const QRegion ®ion, WindowPaintData& data);