From 892930cebc4235a0a1ef58803fe88c32ccc8b4e9 Mon Sep 17 00:00:00 2001 From: nameoverflow Date: Sun, 25 Feb 2018 23:31:06 +0800 Subject: [PATCH] fix(composition): fix crashes in notebook with inline preedit - Use `TF_ES_ASYNCDONTCARE` to request all editsession --- WeaselTSF/Composition.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WeaselTSF/Composition.cpp b/WeaselTSF/Composition.cpp index 759b02fb2..cd60f7a86 100644 --- a/WeaselTSF/Composition.cpp +++ b/WeaselTSF/Composition.cpp @@ -73,7 +73,7 @@ void WeaselTSF::_StartComposition(ITfContext *pContext, BOOL fCUASWorkaroundEnab if ((pStartCompositionEditSession = new CStartCompositionEditSession(this, pContext, fCUASWorkaroundEnabled)) != NULL) { HRESULT hr; - pContext->RequestEditSession(_tfClientId, pStartCompositionEditSession, TF_ES_SYNC | TF_ES_READWRITE, &hr); + pContext->RequestEditSession(_tfClientId, pStartCompositionEditSession, TF_ES_ASYNCDONTCARE | TF_ES_READWRITE, &hr); pStartCompositionEditSession->Release(); } } @@ -114,7 +114,7 @@ void WeaselTSF::_EndComposition(ITfContext *pContext) if ((pEditSession = new CEndCompositionEditSession(this, pContext, _pComposition)) != NULL) { - pContext->RequestEditSession(_tfClientId, pEditSession, TF_ES_SYNC | TF_ES_READWRITE, &hr); + pContext->RequestEditSession(_tfClientId, pEditSession, TF_ES_ASYNCDONTCARE | TF_ES_READWRITE, &hr); pEditSession->Release(); } }