diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2012-10-01 12:29:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-02 13:22:49 +0200 |
commit | 5ba061a66e6aba4929cc77823a35e4714515ba7f (patch) | |
tree | 22afd2937776b2ccdb4a8da69b6b997baf1b64f7 /src/plugins/platforms/xcb/qxcbclipboard.cpp | |
parent | caaa94b0419473fb39aeff2005b9830166f1ad1d (diff) |
Retrieve drop data with a proper timestamp
Occasionally drag-and-drop was returning empty mimedata due to
using wrong value for timestamp. Accoring to the xdnd specification
we must use timestamp from XdndPosition or XdndDroptime for retrieving
the data.
Task-number: QTBUG-27367
Change-Id: Iadb6b6989cfc4e8ab241e2fd0ded59355108f22f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbclipboard.cpp')
-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 3a9eaefa62..f021ab8b4a 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.cpp +++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp @@ -846,13 +846,15 @@ QByteArray QXcbClipboard::getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtAto return getSelection(modeAtom, fmtAtom, atom(QXcbAtom::_QT_SELECTION)); } -QByteArray QXcbClipboard::getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property) +QByteArray QXcbClipboard::getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t time) { QByteArray buf; xcb_window_t win = requestor(); + if (time == 0) time = connection()->time(); + xcb_delete_property(xcb_connection(), win, property); - xcb_convert_selection(xcb_connection(), win, selection, target, property, connection()->time()); + xcb_convert_selection(xcb_connection(), win, selection, target, property, time); connection()->sync(); |