From f6cbc08a7db3c2185b6eae768c026c58f577b0bc Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 27 Sep 2017 17:52:06 +0200 Subject: [PATCH] Fix bad refresh when changing zoom level Replace the tricky code in LFUN_SCREEN_FONT_UPDATE and replace it with proper use of DispatchResult flags. LFUN_BUFFER_ZOOM* does not need to call LFUN_SCREEN_FONT_UPDATE, since it already does everything that is required. (cherry picked from commit 9df59aac63bbb56d9d5f5ddcccfaa3ebace2f03d) --- src/frontends/qt4/GuiApplication.cpp | 9 +-------- src/frontends/qt4/GuiView.cpp | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index ee379ffb56..110b63ec21 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1628,14 +1628,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) case LFUN_SCREEN_FONT_UPDATE: { // handle the screen font changes. d->font_loader_.update(); - // Backup current_view_ - GuiView * view = current_view_; - // Set current_view_ to zero to forbid GuiWorkArea::redraw() - // to skip the refresh. - current_view_ = 0; - theBufferList().changed(false); - // Restore current_view_ - current_view_ = view; + dr.screenUpdate(Update::Force | Update::FitCursor); break; } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 785abfdd9b..2aee2735d3 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -4152,7 +4152,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr) // painting so we must reset it. QPixmapCache::clear(); guiApp->fontLoader().update(); - lyx::dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE)); + dr.screenUpdate(Update::Force | Update::FitCursor); break; } -- 2.39.5