Commit f2f7b92c authored by Thomas Surrel's avatar Thomas Surrel Committed by Tomaz Canabrava
Browse files

Fix scrolled line highlight

In some use cases, the line highlighting was not drawn properly, for
example when copying files with scp.
parent 8022b26c
......@@ -668,7 +668,7 @@ void TerminalDisplay::updateImage()
}
if (_scrollBar->highlightScrolledLines().isEnabled()) {
dirtyRegion |= Q_EMIT highlightScrolledLinesRegion(dirtyRegion.isEmpty(), _scrollBar);
dirtyRegion |= Q_EMIT highlightScrolledLinesRegion(_scrollBar);
}
_screenWindow->resetScrollCount();
......
......@@ -498,7 +498,7 @@ Q_SIGNALS:
void drawCurrentResultRect(QPainter &painter, const QRect &searchResultRect);
void highlightScrolledLines(QPainter &painter, bool isTimerActive, QRect rect);
QRegion highlightScrolledLinesRegion(bool nothingChanged, TerminalScrollBar *scrollBar);
QRegion highlightScrolledLinesRegion(TerminalScrollBar *scrollBar);
void drawBackground(QPainter &painter, const QRect &rect, const QColor &backgroundColor, bool useOpacitySetting);
void drawCharacters(QPainter &painter,
......
......@@ -240,7 +240,7 @@ void TerminalPainter::highlightScrolledLines(QPainter &painter, bool isTimerActi
painter.fillRect(rect, color);
}
QRegion TerminalPainter::highlightScrolledLinesRegion(bool nothingChanged, TerminalScrollBar *scrollBar)
QRegion TerminalPainter::highlightScrolledLinesRegion(TerminalScrollBar *scrollBar)
{
const auto display = qobject_cast<TerminalDisplay *>(sender());
......@@ -285,10 +285,6 @@ QRegion TerminalPainter::highlightScrolledLinesRegion(bool nothingChanged, Termi
dirtyRegion |= new_highlight;
scrollBar->highlightScrolledLines().startTimer();
} else if (!nothingChanged || scrollBar->highlightScrolledLines().isNeedToClear()) {
dirtyRegion = scrollBar->highlightScrolledLines().rect();
scrollBar->highlightScrolledLines().rect().setRect(0, 0, 0, 0);
scrollBar->highlightScrolledLines().setNeedToClear(false);
}
return dirtyRegion;
......
......@@ -63,7 +63,7 @@ public Q_SLOTS:
void highlightScrolledLines(QPainter &painter, bool isTimerActive, QRect rect);
// compute which region need to be repainted for scrolled lines highlight
QRegion highlightScrolledLinesRegion(bool nothingChanged, TerminalScrollBar *scrollBar);
QRegion highlightScrolledLinesRegion(TerminalScrollBar *scrollBar);
// draws the background for a text fragment
// if useOpacitySetting is true then the color's alpha value will be set to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment