From 7609607799fa3f21796c1b641debaf0b89aefb9b Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 4 Mar 2016 18:09:58 +0200 Subject: [PATCH] correct fix of OS X shortcuts in Qt patch (see https://codereview.qt-project.org/#/c/150154/) --- Telegram/_qtbase_5_5_1_patch.diff | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Telegram/_qtbase_5_5_1_patch.diff b/Telegram/_qtbase_5_5_1_patch.diff index 2b727bab4c..2fd2db7b50 100644 --- a/Telegram/_qtbase_5_5_1_patch.diff +++ b/Telegram/_qtbase_5_5_1_patch.diff @@ -11204,18 +11204,30 @@ index ca92103..f681b08 100644 p.setCompositionMode(QPainter::CompositionMode_Source); const QVector rects = region.rects(); 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 +++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm -@@ -356,7 +356,7 @@ Qt::KeyboardModifiers QCocoaKeyMapper::queryKeyboardModifiers() - bool QCocoaKeyMapper::updateKeyboard() - { - const UCKeyboardLayout *uchrData = 0; -- QCFType source = TISCopyCurrentKeyboardInputSource(); -+ QCFType source = TISCopyCurrentASCIICapableKeyboardInputSource();//TISCopyCurrentKeyboardInputSource(); - if (keyboard_mode != NullMode && source == currentInputSource) { - return false; +@@ -384,6 +384,11 @@ bool QCocoaKeyMapper::updateKeyboard() + keyboardInputLocale = QLocale::c(); + keyboardInputDirection = Qt::LeftToRight; } ++ ++ const auto newMode = keyboard_mode; ++ deleteLayouts(); ++ keyboard_mode = newMode; ++ + return true; + } + +@@ -466,7 +471,7 @@ QList 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 index 713758c..9b23ca2 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm