]> git.lyx.org Git - features.git/commitdiff
Bring window to front only for single-instance mode
authorEnrico Forestieri <forenr@lyx.org>
Mon, 4 Jul 2016 23:01:02 +0000 (01:01 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 4 Jul 2016 23:01:02 +0000 (01:01 +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.

src/frontends/qt4/GuiApplication.cpp

index 9d2f3c318c1f9547d9165da9dd099bf4c1deb83f..65862079a3afb329cc77ee816dc65be007b18817 100644 (file)
@@ -1680,7 +1680,7 @@ 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();
@@ -1690,9 +1690,11 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        // but let's make sure
                        LASSERT(current_view_, break);
                        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;
        }