]> git.lyx.org Git - features.git/commitdiff
Some improvements related to Debug::PAINTING
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Oct 2017 15:39:02 +0000 (17:39 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Oct 2017 15:39:02 +0000 (17:39 +0200)
Avoid blinking the cursor when these debug messages are active.
This avoids a lot of debug information.

src/TextMetrics.cpp
src/frontends/qt4/GuiWorkArea.cpp

index 21d34bc7c5002a59bb3a0d0f0e238bd69a60a637..c4ed9ca4af607d7ae46a2c71d108410b8dd643f5 100644 (file)
@@ -1928,10 +1928,10 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const
                // Instrumentation for testing row cache (see also
                // 12 lines lower):
                if (lyxerr.debugging(Debug::PAINTING)
-                       && (row.selection() || pi.full_repaint || row_has_changed)) {
-                               string const foreword = text_->isMainText() ?
-                                       "main text redraw " : "inset text redraw: ";
-                       LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " row=" << i
+                   && (row.selection() || pi.full_repaint || row_has_changed)) {
+                       string const foreword = text_->isMainText() ? "main text redraw "
+                               : "inset text redraw: ";
+                       LYXERR0(foreword << "pit=" << pit << " row=" << i
                                << " row_selection="    << row.selection()
                                << " full_repaint="     << pi.full_repaint
                                << " row_has_changed="  << row_has_changed
index a24e8da71151bd1c800ff33a6c6a02422e86f0d9..264933b082d4a1eff3244cc7ef750b54b0506e89 100644 (file)
@@ -431,12 +431,15 @@ void GuiWorkArea::startBlinkingCaret()
 
        d->showCaret();
 
-       //we're not supposed to cache this value.
-       int const time = QApplication::cursorFlashTime() / 2;
-       if (time <= 0)
-               return;
-       d->caret_timeout_.setInterval(time);
-       d->caret_timeout_.start();
+       // Avoid blinking when debugging PAINTING, since it creates too much noise
+       if (!lyxerr.debugging(Debug::PAINTING)) {
+               // we are not supposed to cache this value.
+               int const time = QApplication::cursorFlashTime() / 2;
+               if (time <= 0)
+                       return;
+               d->caret_timeout_.setInterval(time);
+               d->caret_timeout_.start();
+       }
 }