From 9fb27bc0baee8e8fc2fe55b63adfdc575074a2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 12 Jan 2015 11:43:29 +0100 Subject: [PATCH 1/3] [decoration] Use client's depth in X11Renderer for put_image If the Client uses ARGB the depth is not 24, thus we should use the actual depth from the Client. BUG: 342757 --- decorations/decorationrenderer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/decorations/decorationrenderer.cpp b/decorations/decorationrenderer.cpp index d5e9f744a1..5c281e634d 100644 --- a/decorations/decorationrenderer.cpp +++ b/decorations/decorationrenderer.cpp @@ -140,7 +140,8 @@ void X11Renderer::render() } QImage image = renderToImage(geo); xcb_put_image(c, XCB_IMAGE_FORMAT_Z_PIXMAP, client()->client()->frameId(), m_gc, - image.width(), image.height(), geo.x(), geo.y(), 0, 24, image.byteCount(), image.constBits()); + image.width(), image.height(), geo.x(), geo.y(), 0, client()->client()->depth(), + image.byteCount(), image.constBits()); }; renderPart(left); renderPart(top); From fcd8cf3adaa4153c0da6e5245db8e8073fe824bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 12 Jan 2015 08:46:39 +0100 Subject: [PATCH 2/3] [glxbackend] Introduce env variable KWIN_USE_INTEL_SWAP_EVENT The feature is pretty much untested as it depends on Qt 5.4 and this was not a requirement during the development of 5.2. On the other hand regressions in this feature are very severe as it can freeze the screen and by that render the system unusable. This change disables the feature by default. To enable it use the environment variable KWIN_USE_INTEL_SWAP_EVENT=1. CCBUG: 342582 REVIEW: 122008 --- glxbackend.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glxbackend.cpp b/glxbackend.cpp index 78efa4ebc3..c97fbee474 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -183,7 +183,9 @@ void GlxBackend::init() m_haveMESASwapControl = hasGLExtension(QByteArrayLiteral("GLX_MESA_swap_control")); m_haveEXTSwapControl = hasGLExtension(QByteArrayLiteral("GLX_EXT_swap_control")); m_haveSGISwapControl = hasGLExtension(QByteArrayLiteral("GLX_SGI_swap_control")); - m_haveINTELSwapEvent = hasGLExtension(QByteArrayLiteral("GLX_INTEL_swap_event")); + // only enable Intel swap event if env variable is set, see BUG 342582 + m_haveINTELSwapEvent = hasGLExtension(QByteArrayLiteral("GLX_INTEL_swap_event")) + && qgetenv("KWIN_USE_INTEL_SWAP_EVENT") == QByteArrayLiteral("1"); if (m_haveINTELSwapEvent) { const QList tokens = QByteArray(qVersion()).split('.'); From c4fb3cd55df35aeaf6d81ddc7478f9d95dc5bb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 5 Jan 2015 14:30:42 +0100 Subject: [PATCH 3/3] [kdecoration] Try falling back to default plugin and Aurorae If the configured decoration plugin fails to load, we try to load the default decoration plugin. If that also fails to load, we try to load Aurorae, which is shipped with KWin, so the chances are higher that it is available. Also the checks in Aurorae are improved to fall back to the Plastik theme if the selected SVG theme is not available. BUG: 341014 FIXED-IN: 5.2.0 REVIEW: 121859 --- clients/aurorae/src/aurorae.cpp | 5 ++++- decorations/decorationbridge.cpp | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 428063ddee..2acc1f44ca 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -139,7 +139,10 @@ QQmlComponent *Helper::component(const QString &themeName) m_svgComponent.reset(new QQmlComponent(m_engine.data())); m_svgComponent->loadUrl(QUrl(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/aurorae/aurorae.qml")))); } - return m_svgComponent.data(); + // verify that the theme exists + if (!QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("aurorae/themes/%1/%1rc").arg(themeName.mid(16))).isEmpty()) { + return m_svgComponent.data(); + } } // try finding the QML package auto it = m_components.constFind(themeName); diff --git a/decorations/decorationbridge.cpp b/decorations/decorationbridge.cpp index ba41d6a6c7..240c284b24 100644 --- a/decorations/decorationbridge.cpp +++ b/decorations/decorationbridge.cpp @@ -47,6 +47,7 @@ namespace Decoration { static const QString s_pluginName = QStringLiteral("org.kde.kdecoration2"); +static const QString s_defaultPlugin = QStringLiteral("org.kde.breeze"); KWIN_SINGLETON_FACTORY(DecorationBridge) @@ -65,7 +66,7 @@ DecorationBridge::~DecorationBridge() static QString readPlugin() { - return KSharedConfig::openConfig(KWIN_CONFIG)->group(s_pluginName).readEntry("library", QStringLiteral("org.kde.breeze")); + return KSharedConfig::openConfig(KWIN_CONFIG)->group(s_pluginName).readEntry("library", s_defaultPlugin); } QString DecorationBridge::readTheme() const @@ -78,6 +79,18 @@ void DecorationBridge::init() m_plugin = readPlugin(); m_settings = QSharedPointer::create(this); initPlugin(); + if (!m_factory) { + if (m_plugin != s_defaultPlugin) { + // try loading default plugin + m_plugin = s_defaultPlugin; + initPlugin(); + } + // default plugin failed to load, try fallback + if (!m_factory) { + m_plugin = QStringLiteral("org.kde.kwin.aurorae"); + initPlugin(); + } + } } void DecorationBridge::initPlugin()