diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2012-10-01 12:13:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-02 13:22:49 +0200 |
commit | 03fd3a8f34679793b87a5d901202ea2805b89d84 (patch) | |
tree | 7aae7489318f125bce171d110de41c8577c47f82 /src/plugins/platforms | |
parent | ad4111116720bb03cd6da42e5f6448e511879d24 (diff) |
Fixed xdnd protocol-version detection code
Bug introduced when porting from Xlib to xcb. Xcb returns
actual number of bytes read while Xlib returns number
of 8-bit, 16-bit, or 32-bit items stored in the returned data.
Task-number: QTBUG-27403
Change-Id: Ia64da1953ec7be8d32cc591565cd1b41ce8d7dbb
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbdrag.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 4c9b1209ec..ab4489af61 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -414,9 +414,9 @@ void QXcbDrag::move(const QMouseEvent *me) xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0); if (!reply || reply->type == XCB_NONE) target = 0; - target_version = xcb_get_property_value_length(reply) == 1 ? *(uint32_t *)xcb_get_property_value(reply) : 1; - if (target_version > xdnd_version) - target_version = xdnd_version; + + target_version = *(uint32_t *)xcb_get_property_value(reply); + target_version = qMin(xdnd_version, target_version ? target_version : 1); free(reply); } |