Fix double render when scrolling with visible search bar
ClosedPublic

Authored by mglb on Oct 7 2018, 11:42 PM.

Details

Summary

When the search bar is visible and user scrolls terminal contents,
(part of) one line is rendered twice. The effect is visible on
semi-transparent pixels (i.e. antialiasing) with some font sizes.

With this patch, the characters which should be painted are calculated
once. It was done for every rect in a paint region separately before.
When two rectangles included different parts of a line, it was drawn
twice. Only part of the line had visual effect visible, as each
rectangle was cleared before rendering.

Test Plan
  • set font to DejaVu Sans Mono 7pt (tested with 96dpi). Other fonts/sizes can work too, just make sure the bottom edge of the search box is not exactly between lines
  • run printf '%3d▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒\n' $(seq 500)
  • open search box
  • scroll up/down using mouse wheel

Actual result: One line is brighter (painted twice)
Expected result: All boxes should look the same

  • run in a bash/zsh:
reset
printf '.%.0s' $(seq $(( LINES * COLUMNS )))
printf '\033[?7l'
printf '\033[%d;%dH%c' 1 1 A 1 $COLUMNS B $LINES 1 C $LINES $COLUMNS D
read
reset
  • from "File" menu select "Print Screen..."
  • print to PDF file (or real printer if you want)

Expected result: printed document must contain whole terminal screen
(A, B, C, D in top left, top right, bottom left, bottom right corner,
respectively, and dots filling the screen)

Diff Detail

Repository
R319 Konsole
Branch
arc/Fix-double-render-when-scrolling-with-visible-searchbar (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3933
Build 3951: arc lint + arc unit
mglb requested review of this revision.Oct 7 2018, 11:42 PM
mglb created this revision.
mglb edited the test plan for this revision. (Show Details)Oct 7 2018, 11:43 PM

I can confirm the bug

I can confirm this fixes the bug - it will need more testing to avoid any regressions

It appears this causes File->Print Screen save as pdf to crash

ASSERT: "x >= 0 && x < _columns" in file /home/kurthindenburg/Devel/KDE/src/kde/applications/konsole/src/TerminalDisplay.cpp, line 87
KCrash: crashing... crashRecursionCounter = 2

mglb updated this revision to Diff 43706.EditedOct 16 2018, 2:08 AM

Fix printing

mglb updated this revision to Diff 43707.Oct 16 2018, 2:11 AM
mglb edited the test plan for this revision. (Show Details)

Add printing test case

hindenburg accepted this revision.Oct 17 2018, 1:11 PM

Thanks

This revision is now accepted and ready to land.Oct 17 2018, 1:11 PM
This revision was automatically updated to reflect the committed changes.