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 <shawn.rutledge@digia.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This commit is contained in:
Laszlo Agocs 2014-09-05 13:46:56 +02:00
parent 1bb22c40a3
commit c1ed159653
3 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -156,6 +156,8 @@ public:
void forceRoundTrip();
bool supportsWindowDecoration() const;
public slots:
void blockingReadEvents();
void flushRequests();

View File

@ -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;