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 fd78a25a7c)
This commit is contained in:
Juergen Spitzmueller 2024-06-23 14:52:02 +02:00
parent 2cc5ca27fd
commit f9dccb9afb

View 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());