From: Enrico Forestieri Date: Sun, 3 Jul 2016 20:58:25 +0000 (+0200) Subject: Bring window to front after loading a document X-Git-Tag: 2.3.0alpha1~1344 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=16ec606ab40cd659dcb161cde5aa6a66076dbcfd;p=features.git Bring window to front after loading a document Fixes #7875. --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index a8611f784d..9d2f3c318c 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1678,14 +1678,21 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) // but let's make sure LASSERT(current_view_, break); current_view_->openDocument(fname); - // FIXME but then why check current_view_ here? - if (current_view_ && !current_view_->documentBufferView()) + if (!current_view_->documentBufferView()) current_view_->close(); + else { + current_view_->raise(); + current_view_->activateWindow(); + current_view_->showNormal(); + } } else { // we know !d->views.empty(), so this should be ok // but let's make sure LASSERT(current_view_, break); current_view_->openDocument(fname); + current_view_->raise(); + current_view_->activateWindow(); + current_view_->showNormal(); } break; }