Skip to content

Commit 1df2c40

Browse files
committed
fix: show input method on mouse release when terminal has focus
Explicitly call inputMethod()->show() after mouse release to ensure the IME panel appears for text entry in the terminal widget. 在终端窗口拥有焦点时,鼠标释放后显式调用 inputMethod()->show(), 确保输入法面板能够正常弹出。 Log: 鼠标释放后显示输入法 Influence: 终端在获得焦点并点击鼠标后能正常唤起输入法,改善中文等输入法的使用体验。
1 parent 72fbb6e commit 1df2c40

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

3rdparty/terminalwidget/lib/TerminalDisplay.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <QTime>
3434
#include <QFile>
3535
#include <QGridLayout>
36+
#include <QInputMethod>
3637
#include <QLabel>
3738
#include <QLayout>
3839
#include <QPainter>
@@ -2593,6 +2594,9 @@ void TerminalDisplay::mouseReleaseEvent(QMouseEvent* ev)
25932594
charLine + 1 +_scrollBar->value() -_scrollBar->maximum() , 2);
25942595
}
25952596
dragInfo.state = diNone;
2597+
if (hasFocus()) {
2598+
qApp->inputMethod()->show();
2599+
}
25962600
}
25972601

25982602
bool midClick = (ev->button() == MID_BTN);

0 commit comments

Comments
 (0)