summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrtinputcontext.cpp')
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
index a0474b6710..72fc378760 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
@@ -54,6 +54,8 @@ typedef ITypedEventHandler<InputPane*, InputPaneVisibilityEventArgs*> InputPaneV
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods")
+
inline QRectF getInputPaneRect(IInputPane *pane, qreal scaleFactor)
{
Rect rect;
@@ -78,6 +80,8 @@ inline QRectF getInputPaneRect(IInputPane *pane, qreal scaleFactor)
QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen)
: m_screen(screen)
{
+ qCDebug(lcQpaInputMethods) << __FUNCTION__ << screen;
+
IInputPaneStatics *statics;
if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_InputPane).Get(),
&statics))) {
@@ -114,6 +118,7 @@ bool QWinRTInputContext::isInputPanelVisible() const
HRESULT QWinRTInputContext::onShowing(IInputPane *pane, IInputPaneVisibilityEventArgs *)
{
+ qCDebug(lcQpaInputMethods) << __FUNCTION__ << pane;
m_isInputPanelVisible = true;
emitInputPanelVisibleChanged();
return handleVisibilityChange(pane);
@@ -121,6 +126,7 @@ HRESULT QWinRTInputContext::onShowing(IInputPane *pane, IInputPaneVisibilityEven
HRESULT QWinRTInputContext::onHiding(IInputPane *pane, IInputPaneVisibilityEventArgs *)
{
+ qCDebug(lcQpaInputMethods) << __FUNCTION__ << pane;
m_isInputPanelVisible = false;
emitInputPanelVisibleChanged();
return handleVisibilityChange(pane);
@@ -128,6 +134,7 @@ HRESULT QWinRTInputContext::onHiding(IInputPane *pane, IInputPaneVisibilityEvent
HRESULT QWinRTInputContext::handleVisibilityChange(IInputPane *pane)
{
+ qCDebug(lcQpaInputMethods) << __FUNCTION__ << pane;
const QRectF keyboardRect = getInputPaneRect(pane, m_screen->scaleFactor());
if (m_keyboardRect != keyboardRect) {
m_keyboardRect = keyboardRect;
@@ -165,31 +172,35 @@ static HRESULT getInputPane(ComPtr<IInputPane2> *inputPane2)
void QWinRTInputContext::showInputPanel()
{
+ qCDebug(lcQpaInputMethods) << __FUNCTION__;
+
QEventDispatcherWinRT::runOnXamlThread([&]() {
ComPtr<IInputPane2> inputPane;
HRESULT hr = getInputPane(&inputPane);
if (FAILED(hr))
- return hr;
+ return S_OK;
boolean success;
hr = inputPane->TryShow(&success);
if (FAILED(hr) || !success)
qErrnoWarning(hr, "Failed to show input panel.");
- return hr;
+ return S_OK;
});
}
void QWinRTInputContext::hideInputPanel()
{
+ qCDebug(lcQpaInputMethods) << __FUNCTION__;
+
QEventDispatcherWinRT::runOnXamlThread([&]() {
ComPtr<IInputPane2> inputPane;
HRESULT hr = getInputPane(&inputPane);
if (FAILED(hr))
- return hr;
+ return S_OK;
boolean success;
hr = inputPane->TryHide(&success);
if (FAILED(hr) || !success)
qErrnoWarning(hr, "Failed to hide input panel.");
- return hr;
+ return S_OK;
});
}