From c2aea75c220984953c53c3813717713437649999 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 1 Sep 2011 11:13:35 +0200 Subject: Refactor QMouseEvent to contain the position inside the window Rename the default accessors for positions to localPos, windowPos and screenPos, to be explicit about their use. Introduce a QT_NO_INTEGER_EVENT_COORDINATES define so one can make sure to always use the float based coordinates. Fixup all Qt code to use the correct constructor that specifies all three coordinates. Change-Id: If4bb93b8d1e2eb2440260d99680c468706cfe68f Reviewed-on: http://codereview.qt.nokia.com/4058 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qxcbdrag.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index f4e8afadc7..8a6fd29986 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -191,7 +191,8 @@ void QXcbDrag::startDrag() atom(QXcbAtom::XdndTypelist), XCB_ATOM_ATOM, 32, drag_types.size(), (const void *)drag_types.constData()); - QMouseEvent me(QEvent::MouseMove, QCursor::pos(), QCursor::pos(), Qt::LeftButton, + QPointF pos = QCursor::pos(); + QMouseEvent me(QEvent::MouseMove, pos, pos, pos, Qt::LeftButton, QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); move(&me); @@ -1044,7 +1045,8 @@ void QXcbDrag::handleFinished(const xcb_client_message_event_t *event, bool) void QXcbDrag::timerEvent(QTimerEvent* e) { if (e->timerId() == heartbeat && source_sameanswer.isNull()) { - QMouseEvent me(QEvent::MouseMove, QCursor::pos(), QCursor::pos(), Qt::LeftButton, + QPointF pos = QCursor::pos(); + QMouseEvent me(QEvent::MouseMove, pos, pos, pos, Qt::LeftButton, QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); move(&me); } else if (e->timerId() == transaction_expiry_timer) { -- cgit v1.2.3