]> git.lyx.org Git - features.git/commitdiff
Fix bad refresh when changing zoom level
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 27 Sep 2017 15:52:06 +0000 (17:52 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 27 Sep 2017 16:08:20 +0000 (18:08 +0200)
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.

src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiView.cpp

index 65668d3841416b922f572d52865fad3fc4ae3c23..d57511911c5955ee0a2d389f514a0e97d1f4d60b 100644 (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;
        }
 
index 7644efc63f23d207b0ddf295a2e0a66b85f7b691..1a1ca54be1c504f01421170d29ba3a70d039115e 100644 (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;
                }