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.
This commit is contained in:
Jean-Marc Lasgouttes 2017-09-27 17:52:06 +02:00
parent a0bd27d8b1
commit 9df59aac63
2 changed files with 2 additions and 9 deletions

View File

@ -1632,14 +1632,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;
}

View File

@ -4149,7 +4149,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;
}