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/client/qwaylanddisplay.cpp | 13 +++++++++++++ src/client/qwaylanddisplay_p.h | 2 ++ src/client/qwaylandwindow.cpp | 6 +----- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'src/client') diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 264528f6..3eac985f 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 64c02054..b0142004 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 0905cb3a..aaef58d9 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 #include @@ -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; -- cgit v1.2.1