Fix Cocoa mouse position handling.

I'm not sure what "local" and "global" means for 
QWindowSystemInterface::handleMouseEvent. Sending
the mouse position in window coordinates for both
works.
This commit is contained in:
Morten Sorvig 2011-06-07 10:48:21 +02:00
parent bc6f4d14f7
commit 29b29d1b70

View File

@ -137,14 +137,14 @@
- (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