From e7122d79268104419f96b30e11d1a1817a2d6a77 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 11 Oct 2017 17:39:02 +0200 Subject: [PATCH] Some improvements related to Debug::PAINTING Avoid blinking the cursor when these debug messages are active. This avoids a lot of debug information. --- src/TextMetrics.cpp | 8 ++++---- src/frontends/qt4/GuiWorkArea.cpp | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 21d34bc7c5..c4ed9ca4af 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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 diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index a24e8da711..264933b082 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -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(); + } } -- 2.39.5