From 4672d74f98e0445b33de6d859544c442b54a1eea Mon Sep 17 00:00:00 2001 From: Tu Dinh Date: Sat, 19 Dec 2020 04:54:32 +0100 Subject: [PATCH] don't call key edit on uneaten key when not composing skype crashes if RequestEditSession is called when its Alt menu is active --- VietTypeATL/KeyEventSink.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/VietTypeATL/KeyEventSink.cpp b/VietTypeATL/KeyEventSink.cpp index 5b1ac9a..c73e115 100644 --- a/VietTypeATL/KeyEventSink.cpp +++ b/VietTypeATL/KeyEventSink.cpp @@ -151,8 +151,10 @@ STDMETHODIMP KeyEventSink::OnKeyDown(_In_ ITfContext* pic, _In_ WPARAM wParam, _ DBG_DPRINT(L"OnKeyDown wParam = %lx %s", wParam, *pfEaten ? L"eaten" : L"not eaten"); - hr = CallKeyEdit(pic, wParam, lParam, _keyState); - HRESULT_CHECK_RETURN(hr, L"%s", L"CallKeyEdit failed"); + if (*pfEaten || _compositionManager->IsComposing()) { + hr = CallKeyEdit(pic, wParam, lParam, _keyState); + HRESULT_CHECK_RETURN(hr, L"%s", L"CallKeyEdit failed"); + } return S_OK; }