Cocoa integration: fix incorrect keyboard mapping

When switching between different input sources, we have to update layouts.

Task-number: QTBUG-50865
Change-Id: I0c23c19b79a2102dcc533822b0f861c387582c6c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Timur Pocheptsov 2016-11-02 14:19:26 +01:00 committed by Ulf Hermann
parent 28c831fa13
commit 0cae5a4c4b

View File

@ -378,6 +378,10 @@ bool QCocoaKeyMapper::updateKeyboard()
currentInputSource = source;
keyboard_dead = 0;
const auto newMode = keyboard_mode;
deleteLayouts();
keyboard_mode = newMode;
return true;
}
@ -400,10 +404,8 @@ void QCocoaKeyMapper::clearMappings()
void QCocoaKeyMapper::updateKeyMap(unsigned short macVirtualKey, QChar unicodeKey)
{
if (updateKeyboard()) {
// ### Qt 4 did this:
// QKeyMapper::changeKeyboard();
}
updateKeyboard();
if (keyLayout[macVirtualKey])
return;