Closed Bug 1050041 Opened 10 years ago Closed 6 years ago

[TSF][TS_E_NOLAYOUT] FreeCJ (Traditional Chinese TIP) doesn't show candidate window at pressing first character

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: inputmethod)

Spinning off from bug 1049768.

In TSF mode, FreeCJ doesn't show candidate window at pressing first character. It must be caused by a bug of TSF.

Even we return TS_E_NOLAYOUT from ITextStoreACP::GetTextExt(), TIP will receive E_FAIL. However, this doesn't occur if TIP calls ITfContextView::GetRangeFromPoint(). When ITextStoreACP::GetTextExt() returns TS_E_NOLAYOUT, our ITextStoreACP::GetACPFromPoint() always return TS_E_NOLAYOUT.

So, when FreeCJ will get E_FAIL at retrieving a position of text from offset in the text, it should check if ITfContextView::GetRangeFromPoint() returns TS_E_NOLAYOUT. Otherwise, just handle ITextStoreACPSink::OnLayoutChange() which is called when the document is unlocked and these methods returned TS_E_NOLAYOUT during the lock.

First, we should contact the vendor of FreeCJ. If they don't fix this bug, we should try to fix this with a hack.
Assignee: nobody → masayuki
Blocks: 1049768, 1049488
Keywords: inputmethod
Log of inputting first character. FreeCJ doesn't retry to get the character position after a call of OnLayoutChange().

> 0[230f140]: TSF: 0xabeda00 nsTextStore::RequestLock(dwLockFlags=TS_LF_READWRITE | TS_LF_SYNC, phrSession=0x48f78c), mLock=not-specified
> 0[230f140]: TSF: 0xabeda00   Locking (TS_LF_READWRITE) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> 0[230f140]: TSF: 0xabeda00 nsTextStore::InsertTextAtSelection(dwFlags=TF_IAS_QUERYONLY, pchText=0x0 "", cch=0, pacpStart=0x48f374, pacpEnd=0x48f378, pChange=0x48f350), IsComposing()=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=0, acpEnd=0 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::InsertTextAtSelection() succeeded: *pacpStart=0, *pacpEnd=0, *pChange={ acpStart=0, acpOldEnd=0, acpNewEnd=0 })
> 0[230f140]: TSF: 0xabeda00 nsTextStore::OnStartComposition(pComposition=0x4ef8e30, pfOk=0x48f388), mComposition.mView=0x0
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RecordCompositionStartAction(pComposition=0x4ef8e30, aRange=0x4ecb1f4, aPreserveSelection=false), mComposition.mView=0x0
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=0, acpEnd=0 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentContent(): mContent={ mText.Length()=0 }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RecordCompositionStartAction() succeeded: mComposition={ mStart=0, mString.Length()=0, mSelection={ acpStart=0, acpEnd=0, style.ase=TS_AE_END, style.fInterimChar=false } }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::OnStartComposition() succeeded
> 0[230f140]: TSF: 0xabeda00 nsTextStore::SetSelection(ulCount=1, pSelection=48f360 { acpStart=0, acpEnd=0, style={ ase=TS_AE_NONE, fInterimChar=false } }), mComposition.IsComposing()=true
> 0[230f140]: TSF: 0xabeda00   nsTextStore::SetSelectionInternal(pSelection={ acpStart=0, acpEnd=0, style={ ase=TS_AE_NONE, fInterimChar=false} }, aDispatchTextEvent=true), mComposition.IsComposing()=true
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=0, acpEnd=0 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RestartCompositionIfNecessary(aRangeNew=0x0), mComposition.mView=0x4ef8e30
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RestartCompositionIfNecessary(), range=0-0, mComposition={ mStart=0, mString.Length()=0 }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RestartCompositionIfNecessary() succeeded
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RecordCompositionUpdateAction(), mComposition={ mView=0x4ef8e30, mString="" }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=0, acpEnd=0 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RecordCompositionUpdateAction() succeeded
> 0[230f140]: TSF: 0xabeda00   nsTextStore::SetSelection() succeeded
> 0[230f140]: TSF: 0xabeda00 nsTextStore::GetSelection(ulIndex=4294967295, ulCount=1, pSelection=0x48f3f8, pcFetched=0x48f470)
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=0, acpEnd=0 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::GetSelection() succeeded
> 0[230f140]: TSF: 0xabeda00 nsTextStore::SetText(dwFlags=not-specified, acpStart=0, acpEnd=0, pchText=0x48f474 " ", cch=1, pChange=0x48f40c), mComposition.IsComposing()=true
> 0[230f140]: TSF: 0xabeda00   nsTextStore::SetSelectionInternal(pSelection={ acpStart=0, acpEnd=0, style={ ase=TS_AE_END, fInterimChar=false} }, aDispatchTextEvent=false), mComposition.IsComposing()=true
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=0, acpEnd=0 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::InsertTextAtSelectionInternal(aInsertStr=" ", aTextChange=0x48f40c), IsComposing=true
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=0, acpEnd=0 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentContent(): mContent={ mText.Length()=0 }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::InsertTextAtSelectionInternal() succeeded: mWidget=0xc07ac00, mWidget->Destroyed()=false, aTextChange={ acpStart=0, acpOldEnd=0, acpNewEnd=1 }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::SetText() succeeded: pChange={ acpStart=0, acpOldEnd=0, acpNewEnd=1 }
> 0[230f140]: TSF: 0xabeda00 nsTextStore::GetText(acpStart=0, acpEnd=-1, pchPlain=0x75f74c10, cchPlainReq=128, pcchPlainOut=0x48eff0, prgRunInfo=0x75f74d10, ulRunInfoReq=33, pulRunInfoOut=0x75f748ac, pacpNext=0x75f748b0), mComposition={ mStart=0, mString.Length()=1, IsComposing()=true }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=1, acpEnd=1 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentContent(): mContent={ mText.Length()=1 }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::GetText() succeeded: pcchPlainOut=0x48eff0, *prgRunInfo={ uCount=1, type=TS_RT_PLAIN }, *pulRunInfoOut=1979140268, *pacpNext=1979140272)
> 0[230f140]: TSF: 0xabeda00 nsTextStore::OnUpdateComposition(pComposition=0x4ef8e30, pRangeNew=0x0), mComposition.mView=0x4ef8e30
> 0[230f140]: TSF: 0xabeda00   nsTextStore::OnUpdateComposition() succeeded but not complete
> 0[230f140]: TSF: 0xabeda00 nsTextStore::GetActiveView(pvcView=0x48f404)
> 0[230f140]: TSF: 0xabeda00   nsTextStore::GetActiveView() succeeded: *pvcView=1
> 0[230f140]: TSF: 0xabeda00 nsTextStore::GetTextExt(vcView=1, acpStart=0, acpEnd=1, prc=0x48f420, pfClipped=0x48f41c)
> 0[230f140]: TSF: 0xabeda00   nsTextStore::GetTextExt() FAILED due to layout not recomputed at 1
> 0[230f140]: TSF: 0xabeda00 nsTextStore::GetSelection(ulIndex=4294967295, ulCount=1, pSelection=0x48f4fc, pcFetched=0x48f59c)
> 0[230f140]: TSF: 0xabeda00   nsTextStore::CurrentSelection(): acpStart=1, acpEnd=1 (length=0), reverted=false
> 0[230f140]: TSF: 0xabeda00   nsTextStore::GetSelection() succeeded
> 0[230f140]: TSF: 0xabeda00   Unlocked (TS_LF_READWRITE) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 0[230f140]: TSF: 0xabeda00   nsTextStore::FlushPendingActions() flushing COMPOSITION_START={ mSelectionStart=0, mSelectionLength=0 }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::OnSelectionChangeInternal(), mSink=0x4eae254, mSinkMask=TS_AS_TEXT_CHANGE | TS_AS_SEL_CHANGE | TS_AS_LAYOUT_CHANGE | TS_AS_ATTR_CHANGE | TS_AS_STATUS_CHANGE, mIsRecordingActionsWithoutLock=false, mComposition.IsComposing()=true
> 0[230f140]: TSF: 0xabeda00   nsTextStore::FlushPendingActions() dispatching compositionstart event...
> 0[230f140]: TSF: 0xabeda00   nsTextStore::FlushPendingActions() flushing COMPOSITION_UPDATE={ mData="", mRanges=0x138f6e20, mRanges->Length()=2 }
> 0[230f140]: TSF: 0xabeda00   nsTextStore::FlushPendingActions(), dispatching text event...
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RequestLock(), calling ITextStoreACPSink::OnLayoutChange()...
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RequestLock(), calling ITfContextOwnerServices::OnLayoutChange()...
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RequestLock() succeeded: *phrSession=S_OK
> 0[230f140]: TSF: 0xabeda00   nsTextStore::OnLayoutChangeInternal(), calling mSink->OnLayoutChange()...
> 0[230f140]: TSF: 0xabeda00 nsTextStore::RequestLock(dwLockFlags=TS_LF_READ, phrSession=0x48f370), mLock=not-specified
> 0[230f140]: TSF: 0xabeda00   Locking (TS_LF_READ) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> 0[230f140]: TSF: 0xabeda00 nsTextStore::GetActiveView(pvcView=0x48f2ac)
> 0[230f140]: TSF: 0xabeda00   nsTextStore::GetActiveView() succeeded: *pvcView=1
> 0[230f140]: TSF: 0xabeda00 nsTextStore::GetActiveView(pvcView=0x48f27c)
> 0[230f140]: TSF: 0xabeda00   nsTextStore::GetActiveView() succeeded: *pvcView=1
> 0[230f140]: TSF: 0xabeda00   Unlocked (TS_LF_READ) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 0[230f140]: TSF: 0xabeda00   nsTextStore::RequestLock() succeeded: *phrSession=S_OK
Will this bug occur on other TSF-aware apps?
(In reply to Masatoshi Kimura [:emk] from comment #2)
> Will this bug occur on other TSF-aware apps?

If it returns TS_E_NOLAYOUT, yes. Otherwise, no.
Anyway, not showing candidate list is a bug of TIP actually. If it should be shown in fixed position at least. And TIP shouldn't ignore OnLayoutChange() call.
I sent an email to cccltd@cccl.com.hk. I'm not sure if it's the good address to report a bug of Free ChangJie IME, though.
This is really a bug of the TIP. Move this to TE.
Status: NEW → ASSIGNED
Component: Widget: Win32 → Chinese-Traditional
Product: Core → Tech Evangelism
I emailed to them in English, it might cause they ignoring the email...
If you want to test this, you can disable the hack implemented in bug 1054108 by changing intl.tsf.hack.free_chang_jie.do_not_return_no_layout_error to false in about:config.
No longer blocks: 1049488
I noticed them how to disable our hack for testing their product.
> This is really a bug of TIP. Move this to TE.

Tech Evangelism is for Web sites/Web app issues. 
If it's a Web site issue then there is a URL.
If it's a device implementation, it doesn't seem to be the right product?
Okay, then, moving back to Core.
Component: Chinese-Traditional → Widget: Qt
Product: Tech Evangelism → Core
Component: Widget: Qt → Widget: Win32
I've fixed the symptom at bug 1054108. And looks like that the IME developer is not working on Free Changjie. So, let's mark this as WONTFIX.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Summary: [TSF] FreeCJ (Traditional Chinese TIP) doesn't show candidate window at pressing first character → [TSF][TS_E_NOLAYOUT] FreeCJ (Traditional Chinese TIP) doesn't show candidate window at pressing first character
You need to log in before you can comment on or make changes to this bug.