]> git.lyx.org Git - lyx.git/commitdiff
GuiDocument::onBufferViewChanged(): exit early if dialog is not open
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 2 Jul 2024 09:02:36 +0000 (11:02 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 2 Jul 2024 09:02:36 +0000 (11:02 +0200)
This should fix the bug reported at
https://marc.info/?l=lyx-users&m=171957953801548&w=2

src/frontends/qt/GuiDocument.cpp

index 8c6870eb122feeab283ec8c18ebf667d90689ff2..0404fb22c6a2f9b3f523447ee1f8b91118d27dae 100644 (file)
@@ -1871,6 +1871,10 @@ void GuiDocument::onClosing(int const id)
 
 void GuiDocument::onBufferViewChanged()
 {
+       if (!isVisibleView())
+               // dialog not open, nothing to do
+               return;
+
        if (switchback_) {
                // We are just switching back. Nothing to do.
                switchback_ = false;
@@ -1899,8 +1903,8 @@ void GuiDocument::onBufferViewChanged()
                }
        }
 
-       if (isVisibleView())
-               initialiseParams("");
+       // reset params if we haven't bailed out above
+       initialiseParams("");
 }