correct fix of OS X shortcuts in Qt patch (see https://codereview.qt-project.org/#/c/150154/)

This commit is contained in:
John Preston 2016-03-04 18:09:58 +02:00
parent 45fbd7cb24
commit 7609607799
1 changed files with 21 additions and 9 deletions

View File

@ -11204,18 +11204,30 @@ index ca92103..f681b08 100644
p.setCompositionMode(QPainter::CompositionMode_Source); p.setCompositionMode(QPainter::CompositionMode_Source);
const QVector<QRect> rects = region.rects(); const QVector<QRect> rects = region.rects();
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
index c2d206f..d3881f6 100644 index c2d206f..0d4d7ab 100644
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm --- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm +++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
@@ -356,7 +356,7 @@ Qt::KeyboardModifiers QCocoaKeyMapper::queryKeyboardModifiers() @@ -384,6 +384,11 @@ bool QCocoaKeyMapper::updateKeyboard()
bool QCocoaKeyMapper::updateKeyboard() keyboardInputLocale = QLocale::c();
{ keyboardInputDirection = Qt::LeftToRight;
const UCKeyboardLayout *uchrData = 0;
- QCFType<TISInputSourceRef> source = TISCopyCurrentKeyboardInputSource();
+ QCFType<TISInputSourceRef> source = TISCopyCurrentASCIICapableKeyboardInputSource();//TISCopyCurrentKeyboardInputSource();
if (keyboard_mode != NullMode && source == currentInputSource) {
return false;
} }
+
+ const auto newMode = keyboard_mode;
+ deleteLayouts();
+ keyboard_mode = newMode;
+
return true;
}
@@ -466,7 +471,7 @@ QList<int> QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const
Qt::KeyboardModifiers neededMods = ModsTbl[i];
int key = kbItem->qtKey[i];
if (key && key != baseKey && ((keyMods & neededMods) == neededMods)) {
- ret << int(key + (keyMods & ~neededMods));
+ ret << int(key + neededMods);
}
}
return ret;
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index 713758c..9b23ca2 100755 index 713758c..9b23ca2 100755
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm