summaryrefslogtreecommitdiff
path: root/source/kde/kcm-fcitx/destroy-erroroverlay-with-base-widget.patch
diff options
context:
space:
mode:
Diffstat (limited to 'source/kde/kcm-fcitx/destroy-erroroverlay-with-base-widget.patch')
-rw-r--r--source/kde/kcm-fcitx/destroy-erroroverlay-with-base-widget.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/kde/kcm-fcitx/destroy-erroroverlay-with-base-widget.patch b/source/kde/kcm-fcitx/destroy-erroroverlay-with-base-widget.patch
new file mode 100644
index 00000000..dfb7c451
--- /dev/null
+++ b/source/kde/kcm-fcitx/destroy-erroroverlay-with-base-widget.patch
@@ -0,0 +1,46 @@
+From b955a9fc005682ccde57aad3de68405e944f4cf7 Mon Sep 17 00:00:00 2001
+From: Weng Xuetian <wengxt@gmail.com>
+Date: Fri, 11 Dec 2020 12:44:32 -0800
+Subject: [PATCH] Destroy the error erroroverlay with base widget
+
+Fix #19
+---
+ src/erroroverlay.cpp | 3 ++-
+ src/erroroverlay.h | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/erroroverlay.cpp b/src/erroroverlay.cpp
+index efef8f5..0f85fbd 100644
+--- a/src/erroroverlay.cpp
++++ b/src/erroroverlay.cpp
+@@ -60,7 +60,8 @@ ErrorOverlay::ErrorOverlay(QWidget *baseWidget, QWidget *parent) :
+ setAutoFillBackground(true);
+
+ m_BaseWidget->installEventFilter(this);
+-
++ // Destory overlay with the base widget.
++ connect(m_BaseWidget, SIGNAL(destroyed()), this, SLOT(deleteLater()));
+ connect(Fcitx::Global::instance(), SIGNAL(connectStatusChanged(bool)), this, SLOT(onConnectStatusChanged(bool)));
+ onConnectStatusChanged(Fcitx::Global::instance()->inputMethodProxy() != 0);
+ }
+diff --git a/src/erroroverlay.h b/src/erroroverlay.h
+index cf8aeaf..847b456 100644
+--- a/src/erroroverlay.h
++++ b/src/erroroverlay.h
+@@ -21,6 +21,7 @@
+ #define ERROROVERLAY_H
+
+ #include <QWidget>
++#include <QPointer>
+
+ class ErrorOverlay : public QWidget
+ {
+@@ -38,7 +39,7 @@ public slots:
+ void reposition();
+
+ private:
+- QWidget *m_BaseWidget;
++ QPointer<QWidget> m_BaseWidget;
+ bool m_enable;
+ };
+