Do not attempt to change focus when the active view is not the current one.
Fixes location bar address being changed when opening URLs in a background tab.
This commit is contained in:
Dawit Alemayehu 2012-09-05 03:14:52 -04:00
parent 985865bf10
commit 5fa3dbc49f

View file

@ -518,19 +518,20 @@ void KonqView::slotRequestFocus( KParts::ReadOnlyPart * )
void KonqView::setLoading( bool loading, bool hasPending /*= false*/)
{
//kDebug() << "loading=" << loading << "hasPending=" << hasPending;
if (loading) {
// Make sure the focus is restored on the part's widget and not the combo
// box if it starts loading a request. See #304933.
QWidget* partWidget = (m_pPart ? m_pPart->widget() : 0);
if (partWidget && !partWidget->hasFocus()) {
//kDebug() << "SET FOCUS on the widget";
partWidget->setFocus();
}
}
m_bLoading = loading;
m_bPendingRedirection = hasPending;
if ( m_pMainWindow->currentView() == this )
if ( m_pMainWindow->currentView() == this ) {
m_pMainWindow->updateToolBarActions( hasPending );
// Make sure the focus is restored on the part's widget and not the combo
// box if it starts loading a request. See #304933.
if (loading) {
QWidget* partWidget = (m_pPart ? m_pPart->widget() : 0);
if (partWidget && !partWidget->hasFocus()) {
//kDebug() << "SET FOCUS on the widget";
partWidget->setFocus();
}
}
}
m_pMainWindow->viewManager()->setLoading( this, loading || hasPending );
}