From: Jean-Marc Lasgouttes Date: Wed, 10 Apr 2024 10:31:12 +0000 (+0200) Subject: Fixup 'Avoid metrics computation on resize when width did not change' X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9fa3a90f2672b2d454f0cd24f36265151520f5c3;p=features.git Fixup 'Avoid metrics computation on resize when width did not change' When the width of the window did not change, computing full metrics is not necessary in BufferView::resize(), but it is better to redraw the screen (especially with Wayland). Typical use cases are when using M-x to open the minibuffer or going in and out of an equation (which shows/hides the math toolbars). (cherry picked from commit 83e7c74f6b4ce06936f11a5239a6c88f019a43ff) --- diff --git a/src/BufferView.cpp b/src/BufferView.cpp index c03f928c4d..1056459ea2 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2492,8 +2492,11 @@ void BufferView::resize(int width, int height) // Clear the paragraph height cache. d->par_height_.clear(); // Redo the metrics. - updateMetrics(); + updateMetrics(true); } + // metrics is OK, full drawing is necessary now + d->update_flags_ = (d->update_flags_ & ~Update::Force) | Update::ForceDraw; + d->update_strategy_ = FullScreenUpdate; }