From 6d43b06d2b8f101f72d798d10e692fa134963849 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 5 Sep 2014 13:46:56 +0200 Subject: Fix window decorations for GL apps You cannot have rounded corners with an alpha-less config. To make OpenGL applications appearing with the correct decoration, alpha must be enabled. With this fix the OpenGL apps' decoration will now look identical to the SHM apps'. Change-Id: I24431ddab63146f7f697c85277f00f41e5c55e85 Reviewed-by: Shawn Rutledge Reviewed-by: Robin Burchell --- src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp') diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index a891e7682..b2db1ad0c 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -44,12 +44,14 @@ #include #include #include +#include #include "qwaylandeglwindow.h" #include #include #include #include +#include #include #include @@ -60,11 +62,14 @@ QT_BEGIN_NAMESPACE QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QSurfaceFormat &format, QPlatformOpenGLContext *share) : QPlatformOpenGLContext() , m_eglDisplay(eglDisplay) - , m_config(q_configFromGLFormat(m_eglDisplay, format)) - , m_format(q_glFormatFromConfig(m_eglDisplay, m_config)) , m_blitProgram(0) , mUseNativeDefaultFbo(false) { + QSurfaceFormat fmt = format; + if (static_cast(QGuiApplicationPrivate::platformIntegration())->display()->supportsWindowDecoration()) + fmt.setAlphaBufferSize(8); + m_config = q_configFromGLFormat(m_eglDisplay, fmt); + m_format = q_glFormatFromConfig(m_eglDisplay, m_config); m_shareEGLContext = share ? static_cast(share)->eglContext() : EGL_NO_CONTEXT; switch (m_format.renderableType()) { -- cgit v1.2.3