[LyX/2.4.x] Only issue currentWorkareaChanged() if the work area really changed.

Juergen Spitzmueller spitz at lyx.org
Wed Jul 3 07:56:50 UTC 2024


commit f9dccb9afb9f47f724e4c24558b64baf3da4397b
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Jun 23 14:52:02 2024 +0200

    Only issue currentWorkareaChanged() if the work area really changed.
    
    (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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 30048e41fe..bce62416cc 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -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());


More information about the lyx-cvs mailing list