From 754938df6d86fa45daf8746019651c588ee81a71 Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Thu, 7 Jun 2012 11:09:00 -0700 Subject: [PATCH] Bug 755976 - Send empty text and selection when IME is disabled. r=cpeterson --- widget/android/nsWindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index bf75e73bdd3..50794b233dc 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -2169,6 +2169,11 @@ nsWindow::OnIMETextChange(PRUint32 aStart, PRUint32 aOldEnd, PRUint32 aNewEnd) ALOGIME("IME: OnIMETextChange: s=%d, oe=%d, ne=%d", aStart, aOldEnd, aNewEnd); + if (!mInputContext.mIMEState.mEnabled) { + AndroidBridge::NotifyIMEChange(nsnull, 0, 0, 0, 0); + return NS_OK; + } + // A quirk in Android makes it necessary to pass the whole text. // The more efficient way would have been passing the substring from index // aStart to index aNewEnd @@ -2194,6 +2199,11 @@ nsWindow::OnIMESelectionChange(void) { ALOGIME("IME: OnIMESelectionChange"); + if (!mInputContext.mIMEState.mEnabled) { + AndroidBridge::NotifyIMEChange(nsnull, 0, 0, 0, -1); + return NS_OK; + } + nsRefPtr kungFuDeathGrip(this); nsQueryContentEvent event(true, NS_QUERY_SELECTED_TEXT, this); InitEvent(event, nsnull);