Skip to content

Commit

Permalink
fix notifying layout changed without IME window on Firefox 44.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancorvussolis committed Jan 31, 2016
1 parent f25c703 commit 060f886
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
28 changes: 17 additions & 11 deletions imcrvtip/CandidateList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,25 @@ void CCandidateList::_InvokeSfHandler(BYTE sf)
}
}

void CCandidateList::_PreEndCandidateList()
{
_UnadviseTextLayoutSink();

_UnadviseContextKeyEventSink();

if(_pDocumentMgr != NULL)
{
_pDocumentMgr->Pop(0);
}

SafeRelease(&_pContextCandidateWindow);
SafeRelease(&_pDocumentMgr);
}

void CCandidateList::_EndCandidateList()
{
_PreEndCandidateList();

if(_pCandidateWindow != NULL)
{
_pCandidateWindow->_EndUIElement();
Expand All @@ -391,18 +408,7 @@ void CCandidateList::_EndCandidateList()
SafeRelease(&_pCandidateWindow);

SafeRelease(&_pRangeComposition);

_UnadviseContextKeyEventSink();
SafeRelease(&_pContextCandidateWindow);

_UnadviseTextLayoutSink();
SafeRelease(&_pContextDocument);

if(_pDocumentMgr != NULL)
{
_pDocumentMgr->Pop(0);
}
SafeRelease(&_pDocumentMgr);
}

BOOL CCandidateList::_IsShowCandidateWindow()
Expand Down
1 change: 1 addition & 0 deletions imcrvtip/CandidateList.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CCandidateList :

HRESULT _StartCandidateList(TfClientId tid, ITfDocumentMgr *pDocumentMgr,
ITfContext *pContext, TfEditCookie ec, ITfRange *pRange, BOOL reg, BOOL comp);
void _PreEndCandidateList();
void _EndCandidateList();

BOOL _IsShowCandidateWindow();
Expand Down
8 changes: 8 additions & 0 deletions imcrvtip/CandidateWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,14 @@ void CCandidateWindow::_Update()

void CCandidateWindow::_EndCandidateList(BYTE sf)
{
if(!_comp)
{
if(_pCandidateList != NULL)
{
_pCandidateList->_PreEndCandidateList();
}
}

_InvokeSfHandler(sf);

if(_pTextService != NULL)
Expand Down
5 changes: 5 additions & 0 deletions imcrvtip/KeyHandlerChar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ HRESULT CTextService::_HandleCharReturn(TfEditCookie ec, ITfContext *pContext, B

HRESULT CTextService::_HandleCharShift(TfEditCookie ec, ITfContext *pContext)
{
if(!showentry && kana.empty() && roman.empty())
{
_EndCompletionList(ec, pContext);
}

if(showentry || (!inputkey && !kana.empty() && roman.empty()))
{
_EndCompletionList(ec, pContext);
Expand Down

0 comments on commit 060f886

Please sign in to comment.