diff --git a/src/globalsearch/globalsearchwidget.cpp b/src/globalsearch/globalsearchwidget.cpp index 74bb3edb9..015955107 100644 --- a/src/globalsearch/globalsearchwidget.cpp +++ b/src/globalsearch/globalsearchwidget.cpp @@ -359,21 +359,23 @@ bool GlobalSearchWidget::EventFilterSearchWidget(QObject* o, QEvent* e) { return true; break; - case QEvent::FocusIn: { - QFocusEvent* fe = static_cast(e); - switch (fe->reason()) { - case Qt::MouseFocusReason: - case Qt::TabFocusReason: - case Qt::BacktabFocusReason: - if (!ui_->search->text().isEmpty()) - RepositionPopup(); - break; + case QEvent::KeyPress: { + QKeyEvent* ke = static_cast(e); + const int key = ke->key(); + + switch (key) { + case Qt::Key_Up: + case Qt::Key_Down: + case Qt::Key_PageUp: + case Qt::Key_PageDown: + // If we got one of these it means the popup wasn't visible, so show it + // now. + RepositionPopup(); + return true; default: break; } - - break; } default: diff --git a/src/translations/translations.pot b/src/translations/translations.pot index d318c1311..4e3909dc4 100644 --- a/src/translations/translations.pot +++ b/src/translations/translations.pot @@ -4542,7 +4542,7 @@ msgstr "" msgid "does not contain" msgstr "" -#: globalsearch/globalsearchwidget.cpp:729 +#: globalsearch/globalsearchwidget.cpp:731 msgid "e.g." msgstr ""