summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-09-29 14:24:59 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-03 15:31:42 +0200
commit9ac51af0838c87ea0e21a12243ef82513c5df3e5 (patch)
tree27eb91206f532a54376179590e1f67f28d732cee /src/widgets
parent75a66c3d76fe88c9efa22655e75e196d8ec17036 (diff)
Cocoa: Send proper mouse coordinates.
Clear up coordinate system confusion. Also change QApplicationPrivate::pickMouseReceiver to indicate that, yes, it does modify the 3rd argument in addition to returning the mouse receiver widget. Change-Id: If2c44eff65aedfdc78c6da1728f31d6e2db71f9d Reviewed-on: http://codereview.qt-project.org/5919 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qapplication.cpp4
-rw-r--r--src/widgets/kernel/qapplication_p.h2
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 07035e927f..5d5098c1e2 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2865,7 +2865,7 @@ bool QApplicationPrivate::tryModalHelper(QWidget *widget, QWidget **rettop)
\internal
*/
QWidget *QApplicationPrivate::pickMouseReceiver(QWidget *candidate, const QPoint &globalPos,
- QPoint &pos, QEvent::Type type,
+ QPoint *pos, QEvent::Type type,
Qt::MouseButtons buttons, QWidget *buttonDown,
QWidget *alienWidget)
{
@@ -2887,7 +2887,7 @@ QWidget *QApplicationPrivate::pickMouseReceiver(QWidget *candidate, const QPoint
if (mouseGrabber && mouseGrabber != candidate) {
receiver = mouseGrabber;
- pos = receiver->mapFromGlobal(globalPos);
+ *pos = receiver->mapFromGlobal(globalPos);
#ifdef ALIEN_DEBUG
qDebug() << " ** receiver adjusted to:" << receiver << "pos:" << pos;
#endif
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index e451a53b6c..2130a976fe 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -473,7 +473,7 @@ public:
static QString styleSheet;
#endif
static QPointer<QWidget> leaveAfterRelease;
- static QWidget *pickMouseReceiver(QWidget *candidate, const QPoint &globalPos, QPoint &pos,
+ static QWidget *pickMouseReceiver(QWidget *candidate, const QPoint &globalPos, QPoint *pos,
QEvent::Type type, Qt::MouseButtons buttons,
QWidget *buttonDown, QWidget *alienWidget);
static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget,
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp
index 44880158a8..ee5cd7482e 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa.cpp
+++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp
@@ -251,7 +251,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (event->type() == QEvent::MouseButtonPress && !qt_button_down)
qt_button_down = widget;
- QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->globalPos(), mapped, event->type(), event->buttons(),
+ QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->globalPos(), &mapped, event->type(), event->buttons(),
qt_button_down, widget);
if (!receiver) {