diff options
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 13 | ||||
-rw-r--r-- | src/client/qwaylanddisplay_p.h | 2 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 6 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp | 8 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 9 |
5 files changed, 29 insertions, 9 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 264528f6c..3eac985f6 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -56,6 +56,7 @@ #include "qwaylandwindowmanagerintegration_p.h" #include "qwaylandshellintegration_p.h" +#include "qwaylandclientbufferintegration_p.h" #include "qwaylandextendedoutput_p.h" #include "qwaylandextendedsurface_p.h" @@ -335,4 +336,16 @@ QtWayland::xdg_shell *QWaylandDisplay::shellXdg() return mShellXdg.data(); } +bool QWaylandDisplay::supportsWindowDecoration() const +{ + static bool disabled = qgetenv("QT_WAYLAND_DISABLE_WINDOWDECORATION").toInt(); + // Stop early when disabled via the environment. Do not try to load the integration in + // order to play nice with SHM-only, buffer integration-less systems. + if (disabled) + return false; + + static bool integrationSupport = clientBufferIntegration() && clientBufferIntegration()->supportsWindowDecoration(); + return integrationSupport; +} + QT_END_NAMESPACE diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 64c020546..b0142004e 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -156,6 +156,8 @@ public: void forceRoundTrip(); + bool supportsWindowDecoration() const; + public slots: void blockingReadEvents(); void flushRequests(); diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 0905cb3a2..aaef58d99 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -53,7 +53,6 @@ #include "qwaylanddecoration_p.h" #include "qwaylandwindowmanagerintegration_p.h" #include "qwaylandnativeinterface_p.h" -#include "qwaylandclientbufferintegration_p.h" #include <QtCore/QFileInfo> #include <QtCore/QPointer> @@ -484,10 +483,7 @@ bool QWaylandWindow::createDecoration() } } - static bool disableWaylandDecorations = !qgetenv("QT_WAYLAND_DISABLE_WINDOWDECORATION").isEmpty() - || (mDisplay->clientBufferIntegration() && !mDisplay->clientBufferIntegration()->supportsWindowDecoration()); - - if (disableWaylandDecorations) + if (!mDisplay->supportsWindowDecoration()) return false; bool decoration = false; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index a9247d4a1..5feed543c 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -59,11 +59,15 @@ QWaylandEglWindow::QWaylandEglWindow(QWindow *window) , m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration())) , m_waylandEglWindow(0) , m_eglSurface(0) - , m_eglConfig(q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), window->requestedFormat())) , m_contentFBO(0) , m_resize(false) - , m_format(q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig)) { + QSurfaceFormat fmt = window->requestedFormat(); + if (mDisplay->supportsWindowDecoration()) + fmt.setAlphaBufferSize(8); + m_eglConfig = q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), fmt); + m_format = q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig); + // Do not create anything from here. This platform window may belong to a // RasterGLSurface window which may have pure raster content. In this case, where the // window is never actually made current, creating a wl_egl_window and EGL surface 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 <QtWaylandClient/private/qwaylanddisplay_p.h> #include <QtWaylandClient/private/qwaylandwindow_p.h> #include <QtWaylandClient/private/qwaylanddecoration_p.h> +#include <QtWaylandClient/private/qwaylandintegration_p.h> #include "qwaylandeglwindow.h" #include <QDebug> #include <QtPlatformSupport/private/qeglconvenience_p.h> #include <QtGui/private/qopenglcontext_p.h> #include <QtGui/private/qopengltexturecache_p.h> +#include <QtGui/private/qguiapplication_p.h> #include <qpa/qplatformopenglcontext.h> #include <QtGui/QSurfaceFormat> @@ -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<QWaylandIntegration *>(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<QWaylandGLContext *>(share)->eglContext() : EGL_NO_CONTEXT; switch (m_format.renderableType()) { |