]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/18.04'
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Wed, 13 Jun 2018 19:42:41 +0000 (21:42 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Wed, 13 Jun 2018 19:42:41 +0000 (21:42 +0200)
src/search/dolphinsearchbox.cpp

index 12f0c213846d6fe0212836ced33b17949971354d..61f5c2db4f8e341ed22fe0ef079a27a554d10c48 100644 (file)
@@ -231,10 +231,14 @@ bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event)
         // #379135: we get the FocusIn event when we close a tab but we don't want to emit
         // the activated() signal before the removeTab() call in DolphinTabWidget::closeTab() returns.
         // To avoid this issue, we delay the activation of the search box.
-        QTimer::singleShot(0, this, [this] {
-            setActive(true);
-            setFocus();
-        });
+        // We also don't want to schedule the activation process if we are already active,
+        // otherwise we can enter in a loop of FocusIn/FocusOut events with the searchbox of another tab.
+        if (!isActive()) {
+            QTimer::singleShot(0, this, [this] {
+                setActive(true);
+                setFocus();
+            });
+        }
         break;
 
     default: