зеркало из https://github.com/mozilla/pjs.git
Bug 615935: Cancel any complex text composition for a Cocoa NPAPI plugin when it doesn't return kNPEventStartIME for a key down event. r=smichaud a=blocking2.0betaN+
This commit is contained in:
Родитель
dbfab97237
Коммит
39cdd742a5
|
@ -38,6 +38,7 @@
|
|||
|
||||
- (NSTextInputContext*)inputContext;
|
||||
- (BOOL)interpretKeyEvent:(NSEvent*)event string:(NSString**)string;
|
||||
- (void)cancelComposition;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -83,8 +83,7 @@
|
|||
|
||||
- (void)keyboardInputSourceChanged:(NSNotification *)notification
|
||||
{
|
||||
[mInputTextView setString:@""];
|
||||
[self orderOut:nil];
|
||||
[self cancelComposition];
|
||||
}
|
||||
|
||||
- (BOOL)interpretKeyEvent:(NSEvent*)event string:(NSString**)string
|
||||
|
@ -119,4 +118,10 @@
|
|||
return [mInputTextView inputContext];
|
||||
}
|
||||
|
||||
- (void)cancelComposition
|
||||
{
|
||||
[mInputTextView setString:@""];
|
||||
[self orderOut:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -5365,9 +5365,15 @@ static const char* ToEscapedString(NSString* aString, nsCAutoString& aBuf)
|
|||
mGeckoChild->DispatchWindowEvent(pluginEvent);
|
||||
if (!mGeckoChild)
|
||||
return;
|
||||
|
||||
|
||||
if (!mPluginComplexTextInputRequested) {
|
||||
// Ideally we'd cancel any TSM composition here.
|
||||
#ifdef NP_NO_CARBON
|
||||
[[ComplexTextInputPanel sharedComplexTextInputPanel] cancelComposition];
|
||||
#else
|
||||
if (mPluginTSMDoc) {
|
||||
::FixTSMDocument(mPluginTSMDoc);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче