X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/848abc5922167a467bb73107ee6b72e9af3c8317..105fe62eeb3ec3258a35400a1e6cb2901e01ac2d:/src/search/dolphinsearchbox.cpp diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 6cae37e19..61f5c2db4 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -21,31 +21,29 @@ #include "dolphin_searchsettings.h" #include "dolphinfacetswidget.h" +#include "panels/places/placesitemmodel.h" -#include - -#include -#include #include -#include #include +#include +#include +#ifdef HAVE_BALOO +#include +#include +#endif #include #include +#include #include +#include #include +#include #include #include #include #include -#include -#ifdef HAVE_BALOO - #include - #include -#endif -#include - DolphinSearchBox::DolphinSearchBox(QWidget* parent) : QWidget(parent), m_startedSearching(false), @@ -233,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: