commit ec9d0a94209037b080d0d7a5fb2d776b61addda7 Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Tue May 7 12:01:34 2024 +0200
Fixup 527984ed: fix initial screen size when using backing store When using a back store, it is obviously important to resize it whenever the buffer view is resized. The new code path added in 527984ed skipped this part, so that the window was wrong when creating a new window. --- src/frontends/qt/GuiWorkArea.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp index 5935baaf77..ec9bedee5f 100644 --- a/src/frontends/qt/GuiWorkArea.cpp +++ b/src/frontends/qt/GuiWorkArea.cpp @@ -464,6 +464,9 @@ void GuiWorkArea::resizeBufferView() busy(true); bool const caret_in_view = d->buffer_view_->caretInView(); + // Change backing store size if needed + d->resetScreen(); + // Do the actual work: recompute metrics d->buffer_view_->resize(viewport()->width(), viewport()->height()); if (caret_in_view) d->buffer_view_->showCursor(); @@ -1391,10 +1394,8 @@ void GuiWorkArea::paintEvent(QPaintEvent * ev) // LYXERR(Debug::PAINTING, "paintEvent begin: x: " << rc.x() // << " y: " << rc.y() << " w: " << rc.width() << " h: " << rc.height()); - if (d->need_resize_ || pixelRatio() != d->last_pixel_ratio_) { - d->resetScreen(); + if (d->need_resize_ || pixelRatio() != d->last_pixel_ratio_) resizeBufferView(); - } d->last_pixel_ratio_ = pixelRatio(); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs