diff options
author | Palo Kisa <palo.kisa@gmail.com> | 2016-11-07 18:27:17 +0100 |
---|---|---|
committer | Palo Kisa <palo.kisa@gmail.com> | 2016-11-14 19:54:58 +0000 |
commit | 291eba6f8099a0fec8fbd9cf8a1fb67e5c9f4f8d (patch) | |
tree | f5dc2f52c659ad30d7f9508a3e676f15751fb990 /src/plugins/platforms/xcb | |
parent | 80842959c4f63be930c77da39df7ac386dcaa1d7 (diff) |
QClipboard: Fix emitting changed() in XCB
In XCB environment the QClipboard::changed() was not delivered if the
QClipboard::clear() was issued by other Qt app/process.
If the QClipboard::clear() is used, then the owner in
xcb_xfixes_selection_notify_event_t is XCB_NONE, so we need make the
decission to handle this event by the selection_timestamp and our
m_timestamp[mode].
Task-number: QTBUG-56972
Change-Id: If4c486ac02223eac506465cac7ff1a07bd02a187
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbclipboard.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp index d44ebae8f7..40abef4e50 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.cpp +++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp @@ -723,8 +723,10 @@ void QXcbClipboard::handleXFixesSelectionRequest(xcb_xfixes_selection_notify_eve if (mode > QClipboard::Selection) return; - // here we care only about the xfixes events that come from non Qt processes - if (event->owner != XCB_NONE && event->owner != owner()) { + // Note1: Here we care only about the xfixes events that come from other processes. + // Note2: If the QClipboard::clear() is issued, event->owner is XCB_NONE, + // so we check selection_timestamp to not handle our own QClipboard::clear(). + if (event->owner != owner() && event->selection_timestamp > m_timestamp[mode]) { if (!m_xClipboard[mode]) { m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this)); } else { |