summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-10-22 10:17:56 +0200
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-10-24 11:07:03 +0200
commit1c67c2e281f8a5e1af5ae2ef697e570bdd50514b (patch)
tree872f25bd18fcdfd1c5b9683875501c2eaa2e3b85 /src
parente306847cd46e68d86b1d5478c0c05b9a5acb026c (diff)
downloadqtwayland-1c67c2e281f8a5e1af5ae2ef697e570bdd50514b.tar.gz
Fix missing emission of QClipboard::selectionChanged
And add a test to verify we've fixed it. Change-Id: Ic6d5e64b3000444465935f7caf7e32ec9c4f1012 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandprimaryselectionv1.cpp9
-rw-r--r--src/client/qwaylandprimaryselectionv1_p.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/client/qwaylandprimaryselectionv1.cpp b/src/client/qwaylandprimaryselectionv1.cpp
index 3ddf6dac..832f9678 100644
--- a/src/client/qwaylandprimaryselectionv1.cpp
+++ b/src/client/qwaylandprimaryselectionv1.cpp
@@ -96,6 +96,15 @@ QWaylandPrimarySelectionDeviceV1::~QWaylandPrimarySelectionDeviceV1()
destroy();
}
+void QWaylandPrimarySelectionDeviceV1::invalidateSelectionOffer()
+{
+ if (!m_selectionOffer)
+ return;
+
+ m_selectionOffer.reset();
+ QGuiApplicationPrivate::platformIntegration()->clipboard()->emitChanged(QClipboard::Selection);
+}
+
void QWaylandPrimarySelectionDeviceV1::setSelectionSource(QWaylandPrimarySelectionSourceV1 *source)
{
if (source) {
diff --git a/src/client/qwaylandprimaryselectionv1_p.h b/src/client/qwaylandprimaryselectionv1_p.h
index b165c51b..3f0a42a6 100644
--- a/src/client/qwaylandprimaryselectionv1_p.h
+++ b/src/client/qwaylandprimaryselectionv1_p.h
@@ -125,7 +125,7 @@ class QWaylandPrimarySelectionDeviceV1 : public QObject, public QtWayland::zwp_p
public:
~QWaylandPrimarySelectionDeviceV1() override;
QWaylandPrimarySelectionOfferV1 *selectionOffer() const { return m_selectionOffer.data(); }
- void invalidateSelectionOffer() { m_selectionOffer.reset(); }
+ void invalidateSelectionOffer();
QWaylandPrimarySelectionSourceV1 *selectionSource() const { return m_selectionSource.data(); }
void setSelectionSource(QWaylandPrimarySelectionSourceV1 *source);