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>
This commit is contained in:
parent
3c90ac02d1
commit
770a1d7156
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user