Cocoa: Disable touch events.
authorMorten Johan Sorvig <morten.sorvig@nokia.com>
Wed, 17 Oct 2012 08:16:07 +0000 (10:16 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 30 Oct 2012 06:24:17 +0000 (07:24 +0100)
Enabling touch events has a negative impact on overall
performance. In particular, enabling touch events seems
to disable scroll event compression, resulting scroll
processing lag.

Until we find a solution where we can have both proper
scrolling and touch events we choose scrolling over
touch events. Applications that disagree can enable
touch events manually:

NSView *qtView = (NSView *)QGuiApplication::platformNativeInterface()->
nativeResourceForWindow("nsview", qtWindow);
[qtView setAcceptsTouchEvents:YES];

Change-Id: I85cdd6e8c8ed8685c6cd5418c89fed6af02887cd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
src/plugins/platforms/cocoa/qcocoawindow.mm

index b9ad356..d6b4ee6 100644 (file)
@@ -703,11 +703,6 @@ void QCocoaWindow::setNSWindow(NSWindow *window)
                                           name:nil // Get all notifications
                                           object:m_nsWindow];
 
-    // ### Accept touch events by default.
-    // Beware that enabling touch events has a negative impact on the overall performance.
-    // We probably need a QWindowSystemInterface API to enable/disable touch events.
-    [m_contentView setAcceptsTouchEvents:YES];
-
     [window setContentView:m_contentView];
 }