summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-04-16 09:46:53 +0200
committerLiang Qi <liang.qi@qt.io>2019-04-16 09:46:53 +0200
commit6eda0ca6aff3df020f71c74a3834f388cbdc685d (patch)
tree1b62ae5adb63113222b3339a2910150c18cc137a
parent4de344decf7db4d7703575a78d6013a5c776bf1e (diff)
parent0b51286635ca3f724df94dd4d5268c950505f6ec (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/client/qwaylanddisplay_p.h Change-Id: Ie84862aa41623c11abd8f882f428054f30062c77
-rw-r--r--src/3rdparty/protocol/qt_attribution.json2
-rw-r--r--src/client/qwaylanddisplay.cpp13
-rw-r--r--src/client/qwaylanddisplay_p.h6
-rw-r--r--src/client/qwaylandwindow.cpp18
4 files changed, 25 insertions, 14 deletions
diff --git a/src/3rdparty/protocol/qt_attribution.json b/src/3rdparty/protocol/qt_attribution.json
index ad32d3af3..7e068f755 100644
--- a/src/3rdparty/protocol/qt_attribution.json
+++ b/src/3rdparty/protocol/qt_attribution.json
@@ -178,7 +178,7 @@ Copyright © 2015, 2016 Jan Arne Petersen"
"Name": "Wayland EGLStream Controller Protocol",
"QDocModule": "qtwaylandcompositor",
"QtUsage": "Used in the Qt Wayland Compositor",
- "Files": "wayland-eglstream-controller.xml",
+ "Files": "wl-eglstream-controller.xml",
"Description": "Allows clients to request that the compositor creates its EGLStream.",
"Homepage": "https://github.com/NVIDIA/egl-wayland",
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index e96e52fe4..43401325a 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -90,13 +90,6 @@ struct wl_surface *QWaylandDisplay::createSurface(void *handle)
return surface;
}
-QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window)
-{
- if (!mWaylandIntegration->shellIntegration())
- return nullptr;
- return mWaylandIntegration->shellIntegration()->createShellSurface(window);
-}
-
struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion)
{
struct ::wl_region *region = mCompositor.create_region();
@@ -110,12 +103,18 @@ struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion)
::wl_subsurface *QWaylandDisplay::createSubSurface(QWaylandWindow *window, QWaylandWindow *parent)
{
if (!mSubCompositor) {
+ qCWarning(lcQpaWayland) << "Can't create subsurface, not supported by the compositor.";
return nullptr;
}
return mSubCompositor->get_subsurface(window->object(), parent->object());
}
+QWaylandShellIntegration *QWaylandDisplay::shellIntegration() const
+{
+ return mWaylandIntegration->shellIntegration();
+}
+
QWaylandClientBufferIntegration * QWaylandDisplay::clientBufferIntegration() const
{
return mWaylandIntegration->clientBufferIntegration();
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
index 3ced2d9e3..2d5832d8d 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/qwaylanddisplay_p.h
@@ -98,7 +98,7 @@ class QWaylandQtKeyExtension;
class QWaylandWindow;
class QWaylandIntegration;
class QWaylandHardwareIntegration;
-class QWaylandShellSurface;
+class QWaylandShellIntegration;
class QWaylandCursor;
class QWaylandCursorTheme;
@@ -124,13 +124,13 @@ public:
QWaylandScreen *screenForOutput(struct wl_output *output) const;
struct wl_surface *createSurface(void *handle);
- QWaylandShellSurface *createShellSurface(QWaylandWindow *window);
struct ::wl_region *createRegion(const QRegion &qregion);
struct ::wl_subsurface *createSubSurface(QWaylandWindow *window, QWaylandWindow *parent);
+ QWaylandShellIntegration *shellIntegration() const;
QWaylandClientBufferIntegration *clientBufferIntegration() const;
-
QWaylandWindowManagerIntegration *windowManagerIntegration() const;
+
#if QT_CONFIG(cursor)
QWaylandCursor *waylandCursor();
QWaylandCursorTheme *loadCursorTheme(const QString &name, int pixelSize);
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 2a0867765..32c5b1e6e 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -50,6 +50,7 @@
#include "qwaylandnativeinterface_p.h"
#include "qwaylanddecorationfactory_p.h"
#include "qwaylandshmbackingstore_p.h"
+#include "qwaylandshellintegration_p.h"
#include <QtCore/QFileInfo>
#include <QtCore/QPointer>
@@ -127,8 +128,9 @@ void QWaylandWindow::initWindow()
}
} else if (shouldCreateShellSurface()) {
Q_ASSERT(!mShellSurface);
+ Q_ASSERT(mDisplay->shellIntegration());
- mShellSurface = mDisplay->createShellSurface(this);
+ mShellSurface = mDisplay->shellIntegration()->createShellSurface(this);
if (mShellSurface) {
// Set initial surface title
setWindowTitle(window()->title());
@@ -200,6 +202,9 @@ void QWaylandWindow::initializeWlSurface()
bool QWaylandWindow::shouldCreateShellSurface() const
{
+ if (!mDisplay->shellIntegration())
+ return false;
+
if (shouldCreateSubSurface())
return false;
@@ -968,9 +973,16 @@ void QWaylandWindow::requestActivateWindow()
bool QWaylandWindow::isExposed() const
{
+ if (!window()->isVisible())
+ return false;
+
if (mShellSurface)
- return window()->isVisible() && mShellSurface->isExposed();
- return QPlatformWindow::isExposed();
+ return mShellSurface->isExposed();
+
+ if (mSubSurfaceWindow)
+ return mSubSurfaceWindow->parent()->isExposed();
+
+ return !(shouldCreateShellSurface() || shouldCreateSubSurface());
}
bool QWaylandWindow::isActive() const