From d86b0547ead19ab0f0e88718bca0d32fcc2a0057 Mon Sep 17 00:00:00 2001 From: Fuminobu TAKEYAMA Date: Fri, 5 Jun 2020 21:53:27 -0400 Subject: [PATCH] Notify current cursor position might be changed to input methods This patch fixes the issue where the input method (e.g. IBus or Fcitx) window would not be under the cursor. Also, Qt::ImMicroFocus is depreciated so use Qt::ImCursorRectangle. BUG: 420799 FIXED-IN: 20.08 --- src/TerminalDisplay.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 1a68c8df..895440f8 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -129,6 +129,9 @@ void TerminalDisplay::setScreenWindow(ScreenWindow* window) connect(_screenWindow.data(), &Konsole::ScreenWindow::scrolled, this, [this]() { _filterUpdateRequired = true; }); + connect(_screenWindow.data(), &Konsole::ScreenWindow::outputChanged, this, [this]() { + QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle); + }); _screenWindow->setWindowLines(_lines); } } @@ -3407,7 +3410,7 @@ QVariant TerminalDisplay::inputMethodQuery(Qt::InputMethodQuery query) const { const QPoint cursorPos = cursorPosition(); switch (query) { - case Qt::ImMicroFocus: + case Qt::ImCursorRectangle: return imageToWidget(QRect(cursorPos.x(), cursorPos.y(), 1, 1)); case Qt::ImFont: return font();