From 202573e946bcf3e1a6b855853705adeea44bf0b9 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Thu, 30 Apr 2015 22:07:49 +0300 Subject: [PATCH] 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 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/wayland/qwaylanddatadevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp index 03a8c4b83ec..a3e084a0c10 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp +++ b/src/plugins/platforms/wayland/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