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
wilder-portage
Fuminobu TAKEYAMA 6 years ago committed by Kurt Hindenburg
parent 877fd0caf4
commit d86b0547ea
  1. 5
      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();

Loading…
Cancel
Save