mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 15:15:23 +00:00
bug 103611
Autocomplete popup comes up unexpectedly (regression by checkin for bug 81360) NS_TEXT_EVENT=null seems to invoke the popup window, so we need to avoid the event when no composed text by clicking on fields. r=bryner sr=blizzard
This commit is contained in:
parent
6cc249a641
commit
3f85fb74a5
@ -4180,22 +4180,34 @@ NS_IMETHODIMP nsWindow::ResetInputState()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// if no composed text, should just return
|
||||
if(xic->IsPreeditComposing() == PR_FALSE) {
|
||||
IMEComposeEnd(nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// when composed text exists,
|
||||
PRInt32 uniCharSize =
|
||||
xic->ResetIC(&(mIMECompositionUniString),
|
||||
&(mIMECompositionUniStringSize));
|
||||
|
||||
if (uniCharSize) {
|
||||
if (uniCharSize == 0) {
|
||||
// ResetIC() returns 0, need to erase existing composed text
|
||||
// in GDK_IM_PREEDIT_CALLBACKS style
|
||||
if (xic->mInputStyle & GDK_IM_PREEDIT_CALLBACKS) {
|
||||
IMEComposeStart(nsnull);
|
||||
IMEComposeText(nsnull, nsnull, 0, nsnull);
|
||||
IMEComposeEnd(nsnull);
|
||||
}
|
||||
} else {
|
||||
mIMECompositionUniString[uniCharSize] = 0;
|
||||
}
|
||||
|
||||
IMEComposeStart(nsnull);
|
||||
IMEComposeText(nsnull,
|
||||
uniCharSize ? mIMECompositionUniString : nsnull,
|
||||
IMEComposeStart(nsnull);
|
||||
IMEComposeText(nsnull,
|
||||
mIMECompositionUniString,
|
||||
uniCharSize,
|
||||
nsnull);
|
||||
|
||||
// Call IMEComposeEnd() to reset the state of field
|
||||
IMEComposeEnd(nsnull);
|
||||
IMEComposeEnd(nsnull);
|
||||
}
|
||||
if (xic->mInputStyle & GDK_IM_PREEDIT_POSITION) {
|
||||
UpdateICSpot(xic);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user