summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-09-22 16:53:07 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-28 03:17:04 +0200
commit66f8be7b731c44fd1600c80298ba7710d4d06b6e (patch)
tree5c7847f6c4cf31b6fe4159d28959a3923aed2d07
parentc4049750e715f39224a73de9ed1cc69d4f14866a (diff)
Fix mouse coordinate translation when searching for a drop target
Correctly transform the coordinates when mapping from parent to child in the window hierarchy. Also avoid a second roundtrip to the xserver querying information that we already have. Change-Id: Ia13f1c7ee20c60df283562daa4869d6db30a37e9 Reviewed-on: http://codereview.qt-project.org/5558 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index 5422c6089e..12fb8bd857 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -274,7 +274,7 @@ xcb_window_t QXcbDrag::findRealWindow(const QPoint & pos, xcb_window_t w, int md
void QXcbDrag::move(const QMouseEvent *me)
{
- DEBUG() << "QDragManager::move enter";
+ DEBUG() << "QDragManager::move enter" << me->globalPos();
// ###
QPoint globalPos = me->globalPos();
@@ -326,7 +326,7 @@ void QXcbDrag::move(const QMouseEvent *me)
//me
xcb_window_t src = rootwin;
while (target != 0) {
- DNDDEBUG << "checking target for XdndAware" << target;
+ DNDDEBUG << "checking target for XdndAware" << target << lx << ly;
// translate coordinates
translate = ::translateCoordinates(connection(), src, target, lx, ly);
@@ -336,7 +336,8 @@ void QXcbDrag::move(const QMouseEvent *me)
}
lx = translate->dst_x;
ly = translate->dst_y;
- src = translate->child;
+ src = target;
+ xcb_window_t child = translate->child;
free(translate);
// check if it has XdndAware
@@ -350,14 +351,7 @@ void QXcbDrag::move(const QMouseEvent *me)
break;
}
- // find child at the coordinates
- translate = ::translateCoordinates(connection(), src, src, lx, ly);
- if (!translate) {
- target = 0;
- break;
- }
- target = translate->child;
- free(translate);
+ target = child;
}
if (!target || target == QDragManager::self()->shapedPixmapWindow->handle()->winId()) {