From 8005aa8b5a1d70481e50fa7f508389236748303e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 23 Apr 2014 08:19:47 +0200 Subject: [PATCH] Export supported openGLPlatformInterfaces to the DBus interface Allows the KCM to know which platforms are supported (e.g. glx and egl or just egl). --- composite.cpp | 16 ++++++++++++++++ composite.h | 11 +++++++++++ org.kde.kwin.Compositing.xml | 1 + 3 files changed, 28 insertions(+) diff --git a/composite.cpp b/composite.cpp index 1d8d2838ee..6351e520f7 100644 --- a/composite.cpp +++ b/composite.cpp @@ -862,6 +862,22 @@ QString Compositor::compositingType() const } } +QStringList Compositor::supportedOpenGLPlatformInterfaces() const +{ + QStringList interfaces; + bool supportsGlx = (kwinApp()->operationMode() == Application::OperationModeX11); +#ifdef KWIN_HAVE_OPENGLES + supportsGlx = false; +#endif + if (supportsGlx) { + interfaces << QStringLiteral("glx"); + } +#ifdef KWIN_HAVE_EGL + interfaces << QStringLiteral("egl"); +#endif + return interfaces; +} + /***************************************************** * Workspace ****************************************************/ diff --git a/composite.h b/composite.h index 7e18a660c0..a53cdd3629 100644 --- a/composite.h +++ b/composite.h @@ -79,6 +79,16 @@ class Compositor : public QObject { * @li @c gles OpenGL ES 2 **/ Q_PROPERTY(QString compositingType READ compositingType) + /** + * @brief All currently supported OpenGLPlatformInterfaces. + * + * Possible values: + * @li glx + * @li egl + * + * Values depend on operation mode and compile time options. + **/ + Q_PROPERTY(QStringList supportedOpenGLPlatformInterfaces READ supportedOpenGLPlatformInterfaces) public: enum SuspendReason { NoReasonSuspend = 0, UserSuspend = 1<<0, BlockRuleSuspend = 1<<1, ScriptSuspend = 1<<2, AllReasonSuspend = 0xff }; Q_DECLARE_FLAGS(SuspendReasons, SuspendReason) @@ -158,6 +168,7 @@ public: QString compositingNotPossibleReason() const; bool isOpenGLBroken() const; QString compositingType() const; + QStringList supportedOpenGLPlatformInterfaces() const; public Q_SLOTS: void addRepaintFull(); diff --git a/org.kde.kwin.Compositing.xml b/org.kde.kwin.Compositing.xml index ed83fd0289..4b657f0513 100644 --- a/org.kde.kwin.Compositing.xml +++ b/org.kde.kwin.Compositing.xml @@ -6,6 +6,7 @@ +