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>
bb10
Tor Arne Vestbø 2019-11-24 21:57:35 +01:00
parent 3c90ac02d1
commit 770a1d7156
1 changed files with 2 additions and 2 deletions

View File

@ -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)