summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-04-30 22:07:49 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-06-09 08:22:22 +0000
commitcaa58fe9e892cb95d4f990993c8e067b69530ed6 (patch)
treeae92e091c71e223bae29e577376a8bea3511f97a /src
parentf0e852e545789d4d52149ece368fa388c558a43f (diff)
downloadqtwayland-caa58fe9e892cb95d4f990993c8e067b69530ed6.tar.gz
qtwayland-caa58fe9e892cb95d4f990993c8e067b69530ed6.tar.bz2
qtwayland-caa58fe9e892cb95d4f990993c8e067b69530ed6.zip
Don't generate spurious selection events
By calling destroy() on the active wl_data_source before replacing it with a new one and calling set_selection() we trigger a spurious selection(null) event before the one with the offer for the source we are going to set. Change-Id: I6c2f2fd029fa523312b9892c6a5050805dfa83b0 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylanddatadevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp
index 03a8c4b8..a3e084a0 100644
--- a/src/client/qwaylanddatadevice.cpp
+++ b/src/client/qwaylanddatadevice.cpp
@@ -94,10 +94,10 @@ QWaylandDataSource *QWaylandDataDevice::selectionSource() const
void QWaylandDataDevice::setSelectionSource(QWaylandDataSource *source)
{
- m_selectionSource.reset(source);
if (source)
connect(source, &QWaylandDataSource::cancelled, this, &QWaylandDataDevice::selectionSourceCancelled);
set_selection(source ? source->object() : Q_NULLPTR, m_inputDevice->serial());
+ m_selectionSource.reset(source);
}
QWaylandDataOffer *QWaylandDataDevice::dragOffer() const