summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-21 11:10:27 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-21 11:10:27 +0200
commitbf2dec1e32fbd92ba431bf88dc989f209a15aa01 (patch)
tree724b6e0f6cd5e6718a80a7135304f191f76726f8 /src/compositor/extensions
parentf4a29f068e77e8d1a5a08046e47904ff0b6f2d2e (diff)
parenta5dd3692697fcf905749b5686d5d7bfbf47969e1 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/compositor/extensions')
-rw-r--r--src/compositor/extensions/qwaylandivisurface.h2
-rw-r--r--src/compositor/extensions/qwaylandivisurfaceintegration.cpp5
-rw-r--r--src/compositor/extensions/qwaylandivisurfaceintegration_p.h1
-rw-r--r--src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp9
-rw-r--r--src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h2
-rw-r--r--src/compositor/extensions/qwaylandwlshellintegration.cpp5
-rw-r--r--src/compositor/extensions/qwaylandwlshellintegration_p.h1
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.cpp7
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.h3
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5integration.cpp11
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5integration_p.h3
11 files changed, 42 insertions, 7 deletions
diff --git a/src/compositor/extensions/qwaylandivisurface.h b/src/compositor/extensions/qwaylandivisurface.h
index e362eecb9..3fd0ede93 100644
--- a/src/compositor/extensions/qwaylandivisurface.h
+++ b/src/compositor/extensions/qwaylandivisurface.h
@@ -39,7 +39,7 @@
#include <QtWaylandCompositor/QWaylandShellSurface>
-class wl_resource;
+struct wl_resource;
QT_BEGIN_NAMESPACE
diff --git a/src/compositor/extensions/qwaylandivisurfaceintegration.cpp b/src/compositor/extensions/qwaylandivisurfaceintegration.cpp
index 3a3d9c1c9..88b727df4 100644
--- a/src/compositor/extensions/qwaylandivisurfaceintegration.cpp
+++ b/src/compositor/extensions/qwaylandivisurfaceintegration.cpp
@@ -54,6 +54,11 @@ IviSurfaceIntegration::IviSurfaceIntegration(QWaylandQuickShellSurfaceItem *item
connect(m_shellSurface, &QWaylandIviSurface::destroyed, this, &IviSurfaceIntegration::handleIviSurfaceDestroyed);
}
+IviSurfaceIntegration::~IviSurfaceIntegration()
+{
+ m_item->setSurface(nullptr);
+}
+
void IviSurfaceIntegration::handleIviSurfaceDestroyed()
{
m_shellSurface = nullptr;
diff --git a/src/compositor/extensions/qwaylandivisurfaceintegration_p.h b/src/compositor/extensions/qwaylandivisurfaceintegration_p.h
index 534caf642..eaccd9591 100644
--- a/src/compositor/extensions/qwaylandivisurfaceintegration_p.h
+++ b/src/compositor/extensions/qwaylandivisurfaceintegration_p.h
@@ -61,6 +61,7 @@ class IviSurfaceIntegration : public QWaylandQuickShellIntegration
Q_OBJECT
public:
IviSurfaceIntegration(QWaylandQuickShellSurfaceItem *item);
+ ~IviSurfaceIntegration();
private Q_SLOTS:
void handleIviSurfaceDestroyed();
diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp
index 25e9906f0..22a82ff13 100644
--- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp
+++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp
@@ -118,7 +118,14 @@ void QWaylandQuickShellSurfaceItem::setShellSurface(QWaylandShellSurface *shellS
d->m_shellSurface = shellSurface;
- d->m_shellIntegration = shellSurface->createIntegration(this);
+ if (d->m_shellIntegration) {
+ delete d->m_shellIntegration;
+ d->m_shellIntegration = nullptr;
+ }
+
+ if (shellSurface)
+ d->m_shellIntegration = shellSurface->createIntegration(this);
+
emit shellSurfaceChanged();
}
diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h b/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h
index b9eb5ad62..4cd1ebb77 100644
--- a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h
+++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h
@@ -72,7 +72,7 @@ public:
QQuickItem *m_moveItem;
};
-class QWaylandQuickShellIntegration : public QObject
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellIntegration : public QObject
{
Q_OBJECT
public:
diff --git a/src/compositor/extensions/qwaylandwlshellintegration.cpp b/src/compositor/extensions/qwaylandwlshellintegration.cpp
index b32416764..c3d278a52 100644
--- a/src/compositor/extensions/qwaylandwlshellintegration.cpp
+++ b/src/compositor/extensions/qwaylandwlshellintegration.cpp
@@ -68,6 +68,11 @@ WlShellIntegration::WlShellIntegration(QWaylandQuickShellSurfaceItem *item)
connect(m_shellSurface.data(), &QWaylandWlShellSurface::destroyed, this, &WlShellIntegration::handleShellSurfaceDestroyed);
}
+WlShellIntegration::~WlShellIntegration()
+{
+ m_item->setSurface(nullptr);
+}
+
void WlShellIntegration::handleStartMove(QWaylandSeat *seat)
{
grabberState = GrabberState::Move;
diff --git a/src/compositor/extensions/qwaylandwlshellintegration_p.h b/src/compositor/extensions/qwaylandwlshellintegration_p.h
index 814f5e12d..15aec01c6 100644
--- a/src/compositor/extensions/qwaylandwlshellintegration_p.h
+++ b/src/compositor/extensions/qwaylandwlshellintegration_p.h
@@ -61,6 +61,7 @@ class WlShellIntegration : public QWaylandQuickShellIntegration
Q_OBJECT
public:
WlShellIntegration(QWaylandQuickShellSurfaceItem *item);
+ ~WlShellIntegration();
bool mouseMoveEvent(QMouseEvent *event) override;
bool mouseReleaseEvent(QMouseEvent *event) override;
diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp
index 80aa52e70..6a09a6c77 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp
@@ -1070,7 +1070,7 @@ QWaylandXdgPopupV5::QWaylandXdgPopupV5()
/*!
* Constructs a QWaylandXdgPopupV5, associating it with \a xdgShell at the specified \a position
- * for \a surface and initializes it with the given \a parentSurface and \a resource.
+ * for \a surface, and initializes it with the given \a parentSurface and \a resource.
*/
QWaylandXdgPopupV5::QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSurface *surface,
QWaylandSurface *parentSurface, const QPoint &position, const QWaylandResource &resource)
@@ -1087,8 +1087,8 @@ QWaylandXdgPopupV5::QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSur
*/
/*!
- * Initializes the QWaylandXdgPopupV5, associating it with the given \a shell \a surface,
- * \a parentSurface and \a resource.
+ * Initializes the QWaylandXdgPopupV5, associating it with the given \a shell, \a surface,
+ * \a parentSurface, \a position, and \a resource.
*/
void QWaylandXdgPopupV5::initialize(QWaylandXdgShellV5 *shell, QWaylandSurface *surface, QWaylandSurface *parentSurface,
const QPoint& position, const QWaylandResource &resource)
@@ -1103,6 +1103,7 @@ void QWaylandXdgPopupV5::initialize(QWaylandXdgShellV5 *shell, QWaylandSurface *
emit shellChanged();
emit surfaceChanged();
emit parentSurfaceChanged();
+ emit positionChanged();
QWaylandCompositorExtension::initialize();
}
diff --git a/src/compositor/extensions/qwaylandxdgshellv5.h b/src/compositor/extensions/qwaylandxdgshellv5.h
index 269ea8934..4adf0f9b8 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5.h
+++ b/src/compositor/extensions/qwaylandxdgshellv5.h
@@ -212,7 +212,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopupV5 : public QWaylandShellSurfa
Q_PROPERTY(QWaylandXdgShellV5 *shell READ shell NOTIFY shellChanged)
Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
Q_PROPERTY(QWaylandSurface *parentSurface READ parentSurface NOTIFY parentSurfaceChanged)
- Q_PROPERTY(QPoint position READ position)
+ Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
public:
QWaylandXdgPopupV5();
@@ -245,6 +245,7 @@ Q_SIGNALS:
void shellChanged();
void surfaceChanged();
void parentSurfaceChanged();
+ void positionChanged();
private:
void initialize() override;
diff --git a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
index e2aa6b3ea..156d5679b 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
@@ -65,6 +65,11 @@ XdgShellV5Integration::XdgShellV5Integration(QWaylandQuickShellSurfaceItem *item
connect(m_xdgSurface->surface(), &QWaylandSurface::sizeChanged, this, &XdgShellV5Integration::handleSurfaceSizeChanged);
}
+XdgShellV5Integration::~XdgShellV5Integration()
+{
+ m_item->setSurface(nullptr);
+}
+
bool XdgShellV5Integration::mouseMoveEvent(QMouseEvent *event)
{
if (grabberState == GrabberState::Resize) {
@@ -190,6 +195,7 @@ void XdgShellV5Integration::handleSurfaceSizeChanged()
XdgPopupV5Integration::XdgPopupV5Integration(QWaylandQuickShellSurfaceItem *item)
: QWaylandQuickShellIntegration (item)
+ , m_item(item)
, m_xdgPopup(qobject_cast<QWaylandXdgPopupV5 *>(item->shellSurface()))
, m_xdgShell(QWaylandXdgPopupV5Private::get(m_xdgPopup)->m_xdgShell)
{
@@ -206,6 +212,11 @@ XdgPopupV5Integration::XdgPopupV5Integration(QWaylandQuickShellSurfaceItem *item
connect(m_xdgPopup, &QWaylandXdgPopupV5::destroyed, this, &XdgPopupV5Integration::handlePopupDestroyed);
}
+XdgPopupV5Integration::~XdgPopupV5Integration()
+{
+ m_item->setSurface(nullptr);
+}
+
void XdgPopupV5Integration::handlePopupDestroyed()
{
QWaylandXdgShellV5Private *shellPrivate = QWaylandXdgShellV5Private::get(m_xdgShell);
diff --git a/src/compositor/extensions/qwaylandxdgshellv5integration_p.h b/src/compositor/extensions/qwaylandxdgshellv5integration_p.h
index 6f02ab399..90c425e6f 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5integration_p.h
+++ b/src/compositor/extensions/qwaylandxdgshellv5integration_p.h
@@ -60,6 +60,7 @@ class XdgShellV5Integration : public QWaylandQuickShellIntegration
Q_OBJECT
public:
XdgShellV5Integration(QWaylandQuickShellSurfaceItem *item);
+ ~XdgShellV5Integration();
bool mouseMoveEvent(QMouseEvent *event) override;
bool mouseReleaseEvent(QMouseEvent *event) override;
@@ -111,11 +112,13 @@ class XdgPopupV5Integration : public QWaylandQuickShellIntegration
Q_OBJECT
public:
XdgPopupV5Integration(QWaylandQuickShellSurfaceItem *item);
+ ~XdgPopupV5Integration();
private Q_SLOTS:
void handlePopupDestroyed();
private:
+ QWaylandQuickShellSurfaceItem *m_item;
QWaylandXdgPopupV5 *m_xdgPopup;
QWaylandXdgShellV5 *m_xdgShell;
};