зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1257760 TextInputHandler should dispatch keypress event even when a plugin has focus r=m_kato
When a plugin has focus, TextInputHandler shouldn't send native keydown event to interpretKeyEvents of NSView. However, it should dispatch keypress events because shortcut key handlers wait following keypress event. MozReview-Commit-ID: HpG108s2Rde --HG-- extra : rebase_source : de0b76f0d1e78092f6e9cdcece22ab47a0810621
This commit is contained in:
Родитель
a5da57cddc
Коммит
30630d4a6a
|
@ -1616,18 +1616,13 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent)
|
|||
return true;
|
||||
}
|
||||
|
||||
// None of what follows is needed for plugin keyboard input. In fact it
|
||||
// may cause trouble -- for example the call to [mView interpretKeyEvents:]
|
||||
// can, in e10s mode, cause each key typed to appear twice in an IME
|
||||
// composition.
|
||||
if (mWidget->IsPluginFocused()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Let Cocoa interpret the key events, caching IsIMEComposing first.
|
||||
bool wasComposing = IsIMEComposing();
|
||||
bool interpretKeyEventsCalled = false;
|
||||
if (IsIMEEnabled() || IsASCIICapableOnly()) {
|
||||
// Don't call interpretKeyEvents when a plugin has focus. If we call it,
|
||||
// for example, a character is inputted twice during a composition in e10s
|
||||
// mode.
|
||||
if (!mWidget->IsPluginFocused() && (IsIMEEnabled() || IsASCIICapableOnly())) {
|
||||
MOZ_LOG(gLog, LogLevel::Info,
|
||||
("%p TextInputHandler::HandleKeyDownEvent, calling interpretKeyEvents",
|
||||
this));
|
||||
|
|
Загрузка…
Ссылка в новой задаче