From: Andrew Knight Date: Sun, 23 Aug 2015 20:51:26 +0000 (+0300) Subject: winphone: Fix keyboard show/hide calls X-Git-Tag: v5.5.90+alpha1~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c95c2077ce480a2a0192babbe5efe1e23731633;p=platform%2Fupstream%2Fqtbase.git winphone: Fix keyboard show/hide calls These need to occur on the XAML thread. Change-Id: Id42a37df95b09e6d3c0a1b6e593bbf8cbfe5a129 Reviewed-by: Samuel Nevala Reviewed-by: Maurice Kalinowski --- diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp index 7bd9e87ca6..f3b390b4d6 100644 --- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp +++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp @@ -37,7 +37,9 @@ #include "qwinrtinputcontext.h" #include "qwinrtscreen.h" #include +#include +#include #include #include #include @@ -163,10 +165,14 @@ void QWinRTInputContext::showInputPanel() if (FAILED(hr)) return; - boolean success; - hr = inputPane->TryShow(&success); - if (FAILED(hr)) - qErrnoWarning(hr, "Failed to show input panel."); + QEventDispatcherWinRT::runOnXamlThread([&inputPane]() { + HRESULT hr; + boolean success; + hr = inputPane->TryShow(&success); + if (FAILED(hr) || !success) + qErrnoWarning(hr, "Failed to show input panel."); + return hr; + }); } void QWinRTInputContext::hideInputPanel() @@ -176,10 +182,14 @@ void QWinRTInputContext::hideInputPanel() if (FAILED(hr)) return; - boolean success; - hr = inputPane->TryHide(&success); - if (FAILED(hr)) - qErrnoWarning(hr, "Failed to hide input panel."); + QEventDispatcherWinRT::runOnXamlThread([&inputPane]() { + HRESULT hr; + boolean success; + hr = inputPane->TryHide(&success); + if (FAILED(hr) || !success) + qErrnoWarning(hr, "Failed to hide input panel."); + return hr; + }); } #endif // Q_OS_WINPHONE