diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-02-11 15:12:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-11 15:12:00 +0100 |
commit | df62c31807f7b0a8b9bc222b47ccc7016cfaee65 (patch) | |
tree | a7df6263cdb4cc96e2d31486437ec19ca0bf01e5 /src/plugins/platforms/cocoa/qnsview.mm | |
parent | 17de86f2824c1807c0fa7fa7ae0ed3b7d2acca00 (diff) | |
parent | a1fe728fa5bd6cb9e50cf317a58efcf4eea4de2c (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index d4d345f61d..9920d428e9 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -90,6 +90,7 @@ static QTouchDevice *touchDevice = 0; m_shouldSetGLContextinDrawRect = false; currentCustomDragTypes = 0; m_sendUpAsRightButton = false; + m_inputSource = 0; if (!touchDevice) { touchDevice = new QTouchDevice; @@ -108,6 +109,7 @@ static QTouchDevice *touchDevice = 0; m_maskData = 0; m_window = 0; m_subscribesForGlobalFrameNotifications = false; + [m_inputSource release]; [[NSNotificationCenter defaultCenter] removeObserver:self]; delete currentCustomDragTypes; @@ -859,6 +861,12 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) uint deviceId = [theEvent deviceID]; if (!tabletDeviceDataHash->contains(deviceId)) { + // 10.6 sends tablet events for trackpad interaction, but + // not proximity events. Silence the warning to prevent + // flooding the console. + if (QSysInfo::QSysInfo::MacintoshVersion == QSysInfo::MV_10_6) + return; + qWarning("QNSView handleTabletEvent: This tablet device is unknown" " (received no proximity event for it). Discarding event."); return; @@ -1245,6 +1253,10 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) Qt::KeyboardModifiers modifiers = [QNSView convertKeyModifiers: nativeModifiers]; NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers]; NSString *characters = [nsevent characters]; + if (m_inputSource != characters) { + [m_inputSource release]; + m_inputSource = [characters retain]; + } // There is no way to get the scan code from carbon/cocoa. But we cannot // use the value 0, since it indicates that the event originates from somewhere @@ -1381,6 +1393,11 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) { Q_UNUSED(replacementRange) + if (m_sendKeyEvent && m_composingText.isEmpty() && [aString isEqualToString:m_inputSource]) { + // don't send input method events for simple text input (let handleKeyEvent send key events instead) + return; + } + QString commitString; if ([aString length]) { if ([aString isKindOfClass:[NSAttributedString class]]) { |