summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qmultitouch_mac.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-07 19:25:13 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-08 14:39:52 +0000
commitb0c895fa7aa7f4d47dc9fc9ab3a65fbfb69f89ed (patch)
tree99bf53d6660d37d4aed2542128a421ed7d24cd58 /src/plugins/platforms/cocoa/qmultitouch_mac.mm
parentf8807b82207d7f4f41536f777473c8870673c186 (diff)
macOS: Simplify helpers for flipping between quadrant I and IV
The different flip-functions have been replaced by a single function, qt_mac_flip, with overloads for points and rects. This function is primarily used to implement QCocoaScreen::map(To|From)Native, which most clients of qt_flip* have been moved to. This makes it clearer what kind of reference geometry we're flipping in relation to, and simplifies call-sites. Change-Id: I8a0862f94bb2c64a83a1c3168f984a195c0af6db Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qmultitouch_mac.mm')
-rw-r--r--src/plugins/platforms/cocoa/qmultitouch_mac.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac.mm b/src/plugins/platforms/cocoa/qmultitouch_mac.mm
index 79f8af7783..9eca4d2d43 100644
--- a/src/plugins/platforms/cocoa/qmultitouch_mac.mm
+++ b/src/plugins/platforms/cocoa/qmultitouch_mac.mm
@@ -39,6 +39,7 @@
#include "qmultitouch_mac_p.h"
#include "qcocoahelpers.h"
+#include "qcocoascreen.h"
#include <private/qtouchdevice_p.h>
QT_BEGIN_NAMESPACE
@@ -83,7 +84,7 @@ void QCocoaTouch::updateTouchData(NSTouch *nstouch, NSTouchPhase phase)
if (_touchPoint.id == 0 && phase == NSTouchPhaseBegan) {
_trackpadReferencePos = qnpos;
- _screenReferencePos = qt_mac_flipPoint([NSEvent mouseLocation]);
+ _screenReferencePos = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
}
QPointF screenPos = _screenReferencePos;