summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-11-24 21:57:35 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-11-25 18:00:23 +0100
commit770a1d71560f7195fed0ada523884784bc89f791 (patch)
tree820e74375a7fce26a7dfac4ad44cc667c8a5b6ee
parent3c90ac02d1a6dc383c21d3911f0db881f9341802 (diff)
macOS: Replace use of deprecated acceptsTouchEvents API
The equivalent of setting acceptsTouchEvents to YES is enabling indirect touches. Direct touches are enabled by default by AppKit, but can be explicitly disabled by clearing the NSTouchTypeMaskDirect bit. Change-Id: I5ba09d36f6ee2ce962e3ce21bab06537dd1fa5ad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 15329ca708..6e2d446898 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1692,9 +1692,9 @@ void QCocoaWindow::registerTouch(bool enable)
{
m_registerTouchCount += enable ? 1 : -1;
if (enable && m_registerTouchCount == 1)
- [m_view setAcceptsTouchEvents:YES];
+ m_view.allowedTouchTypes |= NSTouchTypeMaskIndirect;
else if (m_registerTouchCount == 0)
- [m_view setAcceptsTouchEvents:NO];
+ m_view.allowedTouchTypes &= ~NSTouchTypeMaskIndirect;
}
void QCocoaWindow::setContentBorderThickness(int topThickness, int bottomThickness)