commit 16ec606ab40cd659dcb161cde5aa6a66076dbcfd
Author: Enrico Forestieri <[email protected]>
Date: Sun Jul 3 22:58:25 2016 +0200
Bring window to front after loading a document
Fixes #7875.
---
src/frontends/qt4/GuiApplication.cpp | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/frontends/qt4/GuiApplication.cpp
b/src/frontends/qt4/GuiApplication.cpp
index a8611f7..9d2f3c3 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;
}