mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 651307 Don't commit composition string on plugins at changing input source r=smichaud
This commit is contained in:
parent
a4ea6b689d
commit
36ce1aa162
@ -2288,6 +2288,8 @@ pref("print.print_extra_margin", 90); // twips (90 twips is an eigth of an inch)
|
||||
// See bug 404131, topmost <panel> element wins to Dashboard on MacOSX.
|
||||
pref("ui.panel.default_level_parent", false);
|
||||
|
||||
pref("ui.plugin.cancel_composition_at_input_source_changed", false);
|
||||
|
||||
pref("mousewheel.system_scroll_override_on_root_content.enabled", false);
|
||||
|
||||
# XP_MACOSX
|
||||
|
@ -26,6 +26,9 @@
|
||||
*/
|
||||
|
||||
#import "ComplexTextInputPanel.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
||||
#define kInputWindowHeight 20
|
||||
|
||||
@ -83,7 +86,23 @@
|
||||
|
||||
- (void)keyboardInputSourceChanged:(NSNotification *)notification
|
||||
{
|
||||
[self cancelComposition];
|
||||
static PRInt8 sDoCancel = -1;
|
||||
if (!sDoCancel || ![self inComposition]) {
|
||||
return;
|
||||
}
|
||||
if (sDoCancel < 0) {
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
NS_ENSURE_TRUE(prefs, );
|
||||
PRBool cancelComposition = PR_FALSE;
|
||||
nsresult rv =
|
||||
prefs->GetBoolPref("ui.plugin.cancel_composition_at_input_source_changed",
|
||||
&cancelComposition);
|
||||
NS_ENSURE_SUCCESS(rv, );
|
||||
sDoCancel = cancelComposition ? 1 : 0;
|
||||
}
|
||||
if (sDoCancel) {
|
||||
[self cancelComposition];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)interpretKeyEvent:(NSEvent*)event string:(NSString**)string
|
||||
|
Loading…
Reference in New Issue
Block a user