From ac08c5ac9d4532b2506c76e8b69249b32d365aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 13 Apr 2017 21:23:40 +0200 Subject: [PATCH] [plugins/qpa] Do not replace a valid FBO with an invalid one Summary: With the TabBox I observed the following issue: 1: trigger TabBox through screen edge 2: exit TabBox 3: trigger TabBox again through screen edge Actual behavior: in step 3 the GUI does not show. If now using Alt+Tab to show the TabBox the gui shows, but through screen edge it stays broken. Investigation showed that the difference is a direct show in screen edge case and a delayed show in Alt+Tab case. Futher investigation shows that an invalid geometry gets requested in the broken case. While this might indicate an issue in another area it makes sense to protect KWin internally against it and not to break rendering. Thus this change ensures that a valid FBO does not get replaced by an invalid sized FBO. Test Plan: Tested that Alt+Tab works correctly when triggered through edge Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D5438 --- plugins/qpa/window.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/qpa/window.cpp b/plugins/qpa/window.cpp index e969577194..93e6d7fee8 100644 --- a/plugins/qpa/window.cpp +++ b/plugins/qpa/window.cpp @@ -151,6 +151,9 @@ QSharedPointer Window::swapFBO() void Window::createFBO() { const QRect &r = geometry(); + if (m_contentFBO && r.size().isEmpty()) { + return; + } m_contentFBO.reset(new QOpenGLFramebufferObject(r.width(), r.height(), QOpenGLFramebufferObject::CombinedDepthStencil)); if (!m_contentFBO->isValid()) { qCWarning(KWIN_QPA) << "Content FBO is not valid";