Use old qt API to use invokeMethod.

This commit is contained in:
Weng Xuetian 2021-04-08 18:52:27 -07:00
parent 9fa57f9602
commit a2f8c69293
No known key found for this signature in database
GPG Key ID: 8E8B898CBF2412F9
2 changed files with 14 additions and 11 deletions

View File

@ -363,17 +363,18 @@ void QFcitxPlatformInputContext::setFocusObject(QObject *object) {
proxy->focusIn();
// We need to delegate this otherwise it may cause self-recursion in
// certain application like libreoffice.
QMetaObject::invokeMethod(
this,
[this, window = lastWindow_]() {
if (window != lastWindow_) {
return;
}
if (validICByWindow(window.data())) {
cursorRectChanged();
}
},
Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "updateCursorRect",
Qt::QueuedConnection,
Q_ARG(QPointer<QWindow>, lastWindow_));
}
}
void QFcitxPlatformInputContext::updateCursorRect(QPointer<QWindow> window) {
if (window != lastWindow_) {
return;
}
if (validICByWindow(window.data())) {
cursorRectChanged();
}
}

View File

@ -211,6 +211,8 @@ private:
bool filterEventFallback(unsigned int keyval, unsigned int keycode,
unsigned int state, bool isRelaese);
Q_INVOKABLE void updateCursorRect(QPointer<QWindow> window);
FcitxQtWatcher *watcher_;
QString preedit_;
QString commitPreedit_;