]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/screen.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / screen.C
index 537a13a8aa67da716962320c9def9e0639fcff86..d7a1f34e55dad26386c26ecefe6c9f32f52c53dc 100644 (file)
@@ -35,8 +35,6 @@
 #include "rowpainter.h"
 #include "version.h"
 
-#include "insets/updatableinset.h"
-
 #include "graphics/GraphicsImage.h"
 #include "graphics/GraphicsLoader.h"
 
@@ -122,7 +120,7 @@ SplashScreen::SplashScreen()
 
 
 LyXScreen::LyXScreen()
-       : greyed_out_(true), cursor_visible_(false), sync_allowed_(true)
+       : greyed_out_(true), cursor_visible_(false)
 {
        // Start loading the pixmap as soon as possible
        if (lyxrc.show_banner) {
@@ -147,20 +145,6 @@ void LyXScreen::checkAndGreyOut()
 
 void LyXScreen::showCursor(BufferView & bv)
 {
-       // This code is currently meaningful only for the Qt frontend.
-       // This is the place (like below in hideCursor) where
-       // processEvents is being called, and things like keystrokes and
-       // mouse clicks are being handed to the LyX core, once every 
-       // cursor blink. 
-       // THERE IS NOT SUPPOSED TO BE ANY OTHER CALL TO processEvents 
-       // ANYWHERE ELSE.
-       // in BufferView::Pimpl::update() and here, the sync_allowed_
-       // guard is set/cleared which is used here to prevent recursive
-       // calls to screen update. startUpdating() and doneUpdating() in
-       // coordcache again contain asserts to detect such recursion.
-       if (sync_allowed_)
-               lyx_gui::sync_events();
-
        if (cursor_visible_)
                return;
 
@@ -206,9 +190,6 @@ void LyXScreen::showCursor(BufferView & bv)
 
 void LyXScreen::hideCursor()
 {
-       if (sync_allowed_)
-               lyx_gui::sync_events();
-
        if (!cursor_visible_)
                return;
 
@@ -226,6 +207,12 @@ void LyXScreen::toggleCursor(BufferView & bv)
 }
 
 
+void LyXScreen::prepareCursor()
+{
+       cursor_visible_ = false;
+}
+
+
 void LyXScreen::redraw(BufferView & bv, ViewMetricsInfo const & vi)
 {
        greyed_out_ = false;
@@ -235,7 +222,6 @@ void LyXScreen::redraw(BufferView & bv, ViewMetricsInfo const & vi)
        expose(0, 0, workarea().workWidth(), workarea().workHeight());
        workarea().getPainter().end();
        theCoords.doneUpdating();
-       sync_allowed_ = true;
 }