]> git.lyx.org Git - lyx.git/commitdiff
Only issue currentWorkareaChanged() if the work area really changed.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 23 Jun 2024 12:52:02 +0000 (14:52 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 3 Jul 2024 07:50:10 +0000 (09:50 +0200)
(this function can be called repeatedly while the work area doesn't
change any further)

(cherry picked from commit fd78a25a7c0b307da32c7cd805ce9f101160610a)

src/frontends/qt/GuiWorkArea.cpp

index 30048e41fe6c0f8835cd9bea4ee8f675b286968c..bce62416cc3e8f664c122d54eb29b0a75149c6e0 100644 (file)
@@ -1950,12 +1950,15 @@ void TabWorkArea::on_currentTabChanged(int i)
        if (i == -1)
                return;
        GuiWorkArea * wa = workArea(i);
+       // is it really a different work area?
+       bool real_change = wa == currentWorkArea();
        LASSERT(wa, return);
        wa->setUpdatesEnabled(true);
        wa->scheduleRedraw(true);
        wa->setFocus();
        ///
-       currentWorkAreaChanged(wa);
+       if (real_change)
+               currentWorkAreaChanged(wa);
 
        LYXERR(Debug::GUI, "currentTabChanged " << i
                << " File: " << wa->bufferView().buffer().absFileName());