From 7978a9efbaf1a025f9dddb4ef63eef715a569147 Mon Sep 17 00:00:00 2001 From: Lukhnos Liu Date: Tue, 18 Jun 2019 22:06:28 -0700 Subject: [PATCH] Update composing buffer after candidate keys (#145) Recent versions of Chrome started to rely on whether composing buffer gets updated after an arrow key event to determine whether to dismiss (force commit) the composing buffer and handle the arrow key event for the omnibox URL suggestions. --- Source/InputMethodController.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/InputMethodController.mm b/Source/InputMethodController.mm index 3ef36cc7..1de10626 100644 --- a/Source/InputMethodController.mm +++ b/Source/InputMethodController.mm @@ -1010,6 +1010,7 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else if (keyCode == kPageUpKeyCode) { @@ -1017,6 +1018,7 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else if (keyCode == kLeftKeyCode) { @@ -1025,10 +1027,12 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else { [self beep]; + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } } @@ -1038,10 +1042,12 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else { [self beep]; + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } } @@ -1051,6 +1057,7 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else { @@ -1058,6 +1065,7 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } } @@ -1067,6 +1075,7 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else { @@ -1074,6 +1083,7 @@ public: if (!updated) { [self beep]; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } } @@ -1086,6 +1096,7 @@ public: gCurrentCandidateController.selectedCandidateIndex = 0; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else if (keyCode == kEndKeyCode && [_candidates count] > 0) { @@ -1096,6 +1107,7 @@ public: gCurrentCandidateController.selectedCandidateIndex = [_candidates count] - 1; } + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } else { @@ -1127,6 +1139,7 @@ public: } [self beep]; + [self updateClientComposingBuffer:_currentCandidateClient]; return YES; } }