File fcitx5-qt-5.9.patch of Package fcitx5-qt

Index: fcitx5-qt-5.0.6/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp
===================================================================
--- fcitx5-qt-5.0.6.orig/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp
+++ fcitx5-qt-5.0.6/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp
@@ -13,6 +13,8 @@
 #include <QPalette>
 #include <QTextCharFormat>
 #include <QWindow>
+#include <QtGlobal>
+#include <QTimer>
 #include <qpa/qplatformcursor.h>
 #include <qpa/qplatformnativeinterface.h>
 #include <qpa/qplatformscreen.h>
@@ -363,9 +365,20 @@ void QFcitxPlatformInputContext::setFocu
         proxy->focusIn();
         // We need to delegate this otherwise it may cause self-recursion in
         // certain application like libreoffice.
+#if (QT_VERSION < QT_VERSION_CHECK(5,10,0))
+	QTimer::singleShot(0, this, [this, window = lastWindow_](){
+	    if (window != lastWindow_) {
+	        return;
+	    }
+	    if (validICByWindow(window.data())) {
+	        cursorRectChanged();
+	    }
+	});
+#else
         QMetaObject::invokeMethod(this, "updateCursorRect",
                                   Qt::QueuedConnection,
                                   Q_ARG(QPointer<QWindow>, lastWindow_));
+#endif
     }
 }
 
openSUSE Build Service is sponsored by