From 0b50e226301cf72aa39188bcca1ae64d70a7d8ec Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Tue, 9 Dec 2025 12:42:51 +0000
Subject: [PATCH] plugins/qpa: Fix build with Qt 6.11 and Qt 6.10.2

(cherry picked from commit 9f9cf05f70d0cdecf70f0025d61161aaa6611c7e)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
---
 src/plugins/qpa/integration.cpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/plugins/qpa/integration.cpp b/src/plugins/qpa/integration.cpp
index cf761fd088..1b98a335b0 100644
--- a/src/plugins/qpa/integration.cpp
+++ b/src/plugins/qpa/integration.cpp
@@ -88,16 +88,15 @@ bool Integration::hasCapability(Capability cap) const
 {
     switch (cap) {
     case ThreadedPixmaps:
-        return true;
     case OpenGL:
-        return true;
-    case ThreadedOpenGL:
-        return false;
-    case BufferQueueingOpenGL:
-        return false;
     case MultipleWindows:
     case NonFullScreenWindows:
+#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 2)
+    case OffscreenSurface:
+#endif
         return true;
+    case ThreadedOpenGL:
+    case BufferQueueingOpenGL:
     case RasterGLSurface:
         return false;
     default:
@@ -140,7 +139,7 @@ QPlatformWindow *Integration::createPlatformWindow(QWindow *window) const
 
 QPlatformOffscreenSurface *Integration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
 {
-    return new OffscreenSurface(surface);
+    return new KWin::QPA::OffscreenSurface(surface);
 }
 
 QPlatformFontDatabase *Integration::fontDatabase() const
-- 
GitLab

