diff -Naur ukui-system-monitor-3.1.2/src/krightwidget.cpp ukui-system-monitor-3.1.2~/src/krightwidget.cpp
--- ukui-system-monitor-3.1.2/src/krightwidget.cpp	2022-02-21 09:12:09.000000000 +0800
+++ ukui-system-monitor-3.1.2~/src/krightwidget.cpp	2024-05-09 17:26:47.485293509 +0800
@@ -408,24 +408,21 @@
         m_animationSearch->setEndValue(m_rectSeachAnimationEnd);
         m_animationSearch->setEasingCurve(QEasingCurve::OutQuad);
         m_animationSearch->start();
+        m_queryWid->layout()->removeWidget(m_queryText);
+        m_searchEditNew->setTextMargins(30,1,0,1);
     } else {
         m_queryText->adjustSize();
         m_animationSearch->setStartValue(m_rectSeachAnimationEnd);
         m_animationSearch->setEndValue(m_rectSeachAnimationBegin);
         m_animationSearch->setEasingCurve(QEasingCurve::InQuad);
         m_animationSearch->start();
+        m_queryWid->layout()->addWidget(m_queryText);
     }
 }
 
 void KRightWidget::animationFinishedSlot()
 {
-    if(m_queryText->parent() == m_queryWid) {
-        m_queryWid->layout()->removeWidget(m_queryText);
-        m_queryText->setParent(nullptr);
-        m_searchEditNew->setTextMargins(30,1,0,1);
-    } else {
-        m_queryWid->layout()->addWidget(m_queryText);
-    }
+
 }
 
 void KRightWidget::onRefreshSearchResult()
