From 397be4f175fd1bc1326fd1c49a0543e4568239c9 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 24 Oct 2021 21:58:18 +0400 Subject: [PATCH] Call QInputMethod::show on TouchEnd Qt calls QInputMethod::show on mouseReleaseEvent, but tdesktop sets Qt::WA_AcceptTouchEvents, so Qt's callback is never called and the keyboard is never shown. Adding the same to TouchEnd event should synchornize the behavior. QInputMethod::hide is called in QWidget::focusOutEvent and shouldn't be affected. --- ui/widgets/input_fields.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/widgets/input_fields.cpp b/ui/widgets/input_fields.cpp index 10ae86d..64c7cf2 100644 --- a/ui/widgets/input_fields.cpp +++ b/ui/widgets/input_fields.cpp @@ -1045,6 +1045,8 @@ void FlatInput::touchEvent(QTouchEvent *e) { if (_touchRightButton) { QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart); contextMenuEvent(&contextEvent); + } else { + QGuiApplication::inputMethod()->show(); } } if (weak) { @@ -1654,6 +1656,8 @@ void InputField::handleTouchEvent(QTouchEvent *e) { if (_touchRightButton) { QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart); contextMenuEvent(&contextEvent); + } else { + QGuiApplication::inputMethod()->show(); } } if (weak) { @@ -3855,6 +3859,8 @@ void MaskedInputField::touchEvent(QTouchEvent *e) { if (_touchRightButton) { QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart); contextMenuEvent(&contextEvent); + } else { + QGuiApplication::inputMethod()->show(); } } if (weak) {