]> git.lyx.org Git - features.git/commitdiff
Bring window to front only for single-instance mode
authorEnrico Forestieri <forenr@lyx.org>
Tue, 5 Jul 2016 21:19:59 +0000 (23:19 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 5 Jul 2016 21:19:59 +0000 (23:19 +0200)
A window manager could be configured such that to maintain a certain
stack order for the windows. It would be annoying that opening a new
file through menu brings up the window, so do this only if we are
loading a file through the lyx-server.

This commit amends f5f8c6fd, so no status line is needed.

src/frontends/qt4/GuiApplication.cpp

index 9abcf061f8fa9b5b4b18666df712388300a57363..375a6ac88a154198a9aaa0b0caa78dc3ec2c502e 100644 (file)
@@ -1662,16 +1662,18 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        current_view_->openDocument(fname);
                        if (!current_view_->documentBufferView())
                                current_view_->close();
-                       else {
+                       else if (cmd.origin() == FuncRequest::LYXSERVER) {
                                current_view_->raise();
                                current_view_->activateWindow();
                                current_view_->showNormal();
                        }
                } else {
                        current_view_->openDocument(fname);
-                       current_view_->raise();
-                       current_view_->activateWindow();
-                       current_view_->showNormal();
+                       if (cmd.origin() == FuncRequest::LYXSERVER) {
+                               current_view_->raise();
+                               current_view_->activateWindow();
+                               current_view_->showNormal();
+                       }
                }
                break;
        }