diff --git a/data/org_kde_kwin.categories b/data/org_kde_kwin.categories
index 8828d7c17f..4f5d231d20 100644
--- a/data/org_kde_kwin.categories
+++ b/data/org_kde_kwin.categories
@@ -15,3 +15,4 @@ kwin_decorations KWin Decorations
kwin_scripting KWin Scripting
aurorae KWin Aurorae Window Decoration Engine
kwin_xkbcommon KWin xkbcommon integration
+kwin_qpa_plugin KWin QtPlatformAbstraction plugin
diff --git a/plugins/qpa/CMakeLists.txt b/plugins/qpa/CMakeLists.txt
index e5eb59a9ac..1a91a0ff17 100644
--- a/plugins/qpa/CMakeLists.txt
+++ b/plugins/qpa/CMakeLists.txt
@@ -15,6 +15,9 @@ set(QPA_SOURCES
window.cpp
)
+include(ECMQtDeclareLoggingCategory)
+ecm_qt_declare_logging_category(QPA_SOURCES HEADER logging.h IDENTIFIER KWIN_QPA CATEGORY_NAME kwin_qpa_plugin DEFAULT_SEVERITY Critical)
+
add_library(KWinQpaPlugin MODULE ${QPA_SOURCES})
target_link_libraries(KWinQpaPlugin
kwin
diff --git a/plugins/qpa/abstractplatformcontext.cpp b/plugins/qpa/abstractplatformcontext.cpp
index b087591fb7..67be945df9 100644
--- a/plugins/qpa/abstractplatformcontext.cpp
+++ b/plugins/qpa/abstractplatformcontext.cpp
@@ -19,6 +19,7 @@ along with this program. If not, see .
*********************************************************************/
#include "abstractplatformcontext.h"
#include "integration.h"
+#include
namespace KWin
{
@@ -54,9 +55,11 @@ static EGLConfig configFromGLFormat(EGLDisplay dpy, const QSurfaceFormat &format
EGLint count;
EGLConfig configs[1024];
if (eglChooseConfig(dpy, config_attribs, configs, 1, &count) == EGL_FALSE) {
+ qCWarning(KWIN_QPA) << "eglChooseConfig failed";
return 0;
}
if (count != 1) {
+ qCWarning(KWIN_QPA) << "eglChooseConfig did not return any configs";
return 0;
}
return configs[0];
@@ -135,6 +138,7 @@ bool AbstractPlatformContext::isValid() const
bool AbstractPlatformContext::bindApi()
{
if (eglBindAPI(isOpenGLES() ? EGL_OPENGL_ES_API : EGL_OPENGL_API) == EGL_FALSE) {
+ qCWarning(KWIN_QPA) << "eglBindAPI failed";
return false;
}
return true;
@@ -211,6 +215,7 @@ void AbstractPlatformContext::createContext(EGLContext shareContext)
}
if (context == EGL_NO_CONTEXT) {
+ qCWarning(KWIN_QPA) << "Failed to create EGL context";
return;
}
m_context = context;
diff --git a/plugins/qpa/sharingplatformcontext.cpp b/plugins/qpa/sharingplatformcontext.cpp
index 4c4567b400..db844412c3 100644
--- a/plugins/qpa/sharingplatformcontext.cpp
+++ b/plugins/qpa/sharingplatformcontext.cpp
@@ -23,6 +23,7 @@ along with this program. If not, see .
#include "../../platform.h"
#include "../../wayland_server.h"
#include "../../shell_client.h"
+#include
#include
@@ -45,6 +46,8 @@ bool SharingPlatformContext::makeCurrent(QPlatformSurface *surface)
window->bindContentFBO();
return true;
}
+ qCWarning(KWIN_QPA) << "Failed to make context current";
+
return false;
}
@@ -58,6 +61,7 @@ void SharingPlatformContext::swapBuffers(QPlatformSurface *surface)
Window *window = static_cast(surface);
auto c = window->shellClient();
if (!c) {
+ qCDebug(KWIN_QPA) << "SwapBuffers called but there is no ShellClient";
return;
}
makeCurrent(surface);
@@ -74,15 +78,18 @@ GLuint SharingPlatformContext::defaultFramebufferObject(QPlatformSurface *surfac
return fbo->handle();
}
}
+ qCDebug(KWIN_QPA) << "No default framebuffer object for internal window";
return 0;
}
void SharingPlatformContext::create()
{
if (config() == 0) {
+ qCWarning(KWIN_QPA) << "Did not get an EGL config";
return;
}
if (!bindApi()) {
+ qCWarning(KWIN_QPA) << "Could not bind API.";
return;
}
createContext(kwinApp()->platform()->sceneEglContext());
diff --git a/plugins/qpa/window.cpp b/plugins/qpa/window.cpp
index 02e77c698c..e5244c323a 100644
--- a/plugins/qpa/window.cpp
+++ b/plugins/qpa/window.cpp
@@ -22,6 +22,7 @@ along with this program. If not, see .
#include "window.h"
#include "../../shell_client.h"
#include "../../wayland_server.h"
+#include
#include
@@ -149,6 +150,9 @@ void Window::createFBO()
{
const QRect &r = geometry();
m_contentFBO.reset(new QOpenGLFramebufferObject(r.width(), r.height(), QOpenGLFramebufferObject::CombinedDepthStencil));
+ if (!m_contentFBO->isValid()) {
+ qCWarning(KWIN_QPA) << "Content FBO is not valid";
+ }
m_resized = false;
}