]> git.lyx.org Git - lyx.git/commit
Reduce metrics updates from 4 to 1 when loading file
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 22 Nov 2023 11:07:51 +0000 (12:07 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 5 Apr 2024 11:06:26 +0000 (13:06 +0200)
commit1d1f95d2ed0bf02e8a9cd9685ed4ba3365b9b493
tree2a1f88855559f52c368cb915dba58df41cb8e28b
parenta23522073c8bb2cd06ddc7cc564e9c78f868a86d
Reduce metrics updates from 4 to 1 when loading file

The number of metrics updates when loading file and showing it in a
new work area is unreasonable.

The first avoided call to updateMetrics() was an explicit resize in
BufferView::init(). Instead, an assertion is suppressed by exiting
early BufferView::processUpdateFlags() when BufferView::ready()
returns false. This is a new method introduced to factor in some
existing tests.

Two other metrics computations are avoided by setting the enclosing
View object busy() while creating the new tab. To make this work
properly, GuiWorkArea::scheduleRedraw has to return early in this
case.

When saving an unnamed document or invoking "Save as...", call
setBusy(false) earlier so that repainting occurs correctly.

Fixes bug #12976.
src/Buffer.cpp
src/BufferView.cpp
src/BufferView.h
src/frontends/qt/GuiWorkArea.cpp