Bring window to front after loading a document

Fixes #7875.
This commit is contained in:
Enrico Forestieri 2016-07-03 22:58:25 +02:00
parent 0f2dc7d0a7
commit 16ec606ab4

View File

@ -1678,14 +1678,21 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// but let's make sure // but let's make sure
LASSERT(current_view_, break); LASSERT(current_view_, break);
current_view_->openDocument(fname); current_view_->openDocument(fname);
// FIXME but then why check current_view_ here? if (!current_view_->documentBufferView())
if (current_view_ && !current_view_->documentBufferView())
current_view_->close(); current_view_->close();
else {
current_view_->raise();
current_view_->activateWindow();
current_view_->showNormal();
}
} else { } else {
// we know !d->views.empty(), so this should be ok // we know !d->views.empty(), so this should be ok
// but let's make sure // but let's make sure
LASSERT(current_view_, break); LASSERT(current_view_, break);
current_view_->openDocument(fname); current_view_->openDocument(fname);
current_view_->raise();
current_view_->activateWindow();
current_view_->showNormal();
} }
break; break;
} }