Only re-show the global search popup on focus events that were caused by the mouse or keyboard.

This commit is contained in:
David Sansome 2011-09-24 13:26:12 +01:00
parent 07528f844b
commit 8551d4a46d
1 changed files with 17 additions and 1 deletions

View File

@ -309,7 +309,23 @@ bool GlobalSearchWidget::EventFilterSearchWidget(QObject* o, QEvent* e) {
return true;
break;
case QEvent::FocusIn:
case QEvent::FocusIn: {
QFocusEvent* fe = static_cast<QFocusEvent*>(e);
switch (fe->reason()) {
case Qt::MouseFocusReason:
case Qt::TabFocusReason:
case Qt::BacktabFocusReason:
if (!ui_->search->text().isEmpty())
RepositionPopup();
break;
default:
break;
}
break;
}
case QEvent::MouseButtonPress:
if (!ui_->search->text().isEmpty())
RepositionPopup();