Bug 971651 - Keyboard Should only send key press events to the webpage that uses the keyboard r=yxl

This commit is contained in:
Fabrice Desré
2014-02-12 22:29:50 -08:00
parent 70fb4a2630
commit 23e3885f7c
2 changed files with 48 additions and 29 deletions

View File

@@ -329,6 +329,7 @@ MozInputMethod.prototype = {
},
uninit: function mozInputMethodUninit() {
this.setActive(false);
Services.obs.removeObserver(this, "inner-window-destroyed");
cpmm.removeMessageListener('Keyboard:FocusChange', this);
cpmm.removeMessageListener('Keyboard:SelectionChange', this);
@@ -428,9 +429,11 @@ MozInputMethod.prototype = {
// If there is already an active context, then this will trigger
// a GetContext:Result:OK event, and we can initialize ourselves.
// Otherwise silently ignored.
cpmm.sendAsyncMessage('Keyboard:Register', {});
cpmm.sendAsyncMessage("Keyboard:GetContext", {});
} else {
// Deactive current input method.
cpmm.sendAsyncMessage('Keyboard:Unregister', {});
if (this._inputcontext) {
this.setInputContext(null);
}