Fix Cocoa mouse position handling.
authorMorten Sorvig <morten.sorvig@nokia.com>
Tue, 7 Jun 2011 08:48:21 +0000 (10:48 +0200)
committerMorten Sorvig <morten.sorvig@nokia.com>
Tue, 7 Jun 2011 08:53:37 +0000 (10:53 +0200)
I'm not sure what "local" and "global" means for
QWindowSystemInterface::handleMouseEvent. Sending
the mouse position in window coordinates for both
works.

src/plugins/platforms/cocoa/qnsview.mm

index ba53bff..5d7fd05 100644 (file)
 
 - (void)handleMouseEvent:(NSEvent *)theEvent;
 {
-    NSPoint point = [self convertPoint: [theEvent locationInWindow] fromView: nil];
-    QPoint qt_localPoint(point.x,point.y);
+    NSPoint windowPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil];
+    QPoint qt_windowPoint(windowPoint.x, windowPoint.y);
 
     NSTimeInterval timestamp = [theEvent timestamp];
     ulong qt_timestamp = timestamp * 1000;
 
-    QWindowSystemInterface::handleMouseEvent(m_window,qt_timestamp,qt_localPoint,QPoint(),m_buttons);
-
+    // ### Should the points be windowPoint and screenPoint?
+    QWindowSystemInterface::handleMouseEvent(m_window, qt_timestamp, qt_windowPoint, qt_windowPoint, m_buttons);
 }
 
 - (void)mouseDown:(NSEvent *)theEvent