summaryrefslogtreecommitdiff
path: root/user/konsole/cursor.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-03-18 18:53:28 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-03-18 18:53:28 +0000
commit40254b068b9389c30608184e33ffce42ee3fc74c (patch)
tree4e9cfee438749117b7d98b80807a7defe7f5848b /user/konsole/cursor.patch
parent8995a81ccd7ce612a0b479b3d528e41c24baaeb5 (diff)
downloadpackages-40254b068b9389c30608184e33ffce42ee3fc74c.tar.gz
packages-40254b068b9389c30608184e33ffce42ee3fc74c.tar.bz2
packages-40254b068b9389c30608184e33ffce42ee3fc74c.tar.xz
packages-40254b068b9389c30608184e33ffce42ee3fc74c.zip
user/konsole: fix cursor rendering bug
Diffstat (limited to 'user/konsole/cursor.patch')
-rw-r--r--user/konsole/cursor.patch87
1 files changed, 87 insertions, 0 deletions
diff --git a/user/konsole/cursor.patch b/user/konsole/cursor.patch
new file mode 100644
index 000000000..621a4f36b
--- /dev/null
+++ b/user/konsole/cursor.patch
@@ -0,0 +1,87 @@
+From 9af659c73e3203e1d5ef3873fa6c0144258b9673 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bauer <wbauer@tmo.at>
+Date: Mon, 4 Mar 2019 09:59:45 -0500
+Subject: Fix ibeam and underline cursor rendering
+
+Summary:
+Since anti-aliasing was enabled in the painter, coordinates need to
+be shifted half a pixel so that they align with the pixel grid,
+otherwise the result gets "blurred" due to the anti-aliasing.
+And as parts of the blurred shape leak outside the cursor rectangle,
+this also leaves artifacts when the cursor moves or blinks as these
+parts are not cleared.
+
+This is basically the same as commit
+e7085310d6d594823d0ed491fa8bdbd99dec4932 for the
+standard block cursor.
+
+BUG: 402589
+
+Test Plan:
+- Switch cursor shape to "I-Beam" or "Underline" in the "Advanced"
+profile settings
+
+The cursors are a single line again now, before they were blurred by
+anti-aliasing.
+
+Screenshots:
+Before:
+{F6656366}
+{F6656370}
+
+After:
+{F6656371}
+{F6656373}
+
+Also, there are no more artifacts when the cursor is moved or
+cursor blinking is enabled.
+
+Reviewers: #konsole, hindenburg
+
+Reviewed By: #konsole, hindenburg
+
+Subscribers: hindenburg, konsole-devel
+
+Tags: #konsole
+
+Differential Revision: https://phabricator.kde.org/D19513
+
+(cherry picked from commit eccfb1f62bbf67ebffee11e241bd05757b826ff1)
+---
+ src/TerminalDisplay.cpp | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
+index 64c831c..7c8137d 100644
+--- a/src/TerminalDisplay.cpp
++++ b/src/TerminalDisplay.cpp
+@@ -958,16 +958,18 @@ void TerminalDisplay::drawCursor(QPainter& painter,
+ }
+ }
+ } else if (_cursorShape == Enum::UnderlineCursor) {
+- painter.drawLine(cursorRect.left(),
+- cursorRect.bottom(),
+- cursorRect.right(),
+- cursorRect.bottom());
++ QLineF line(cursorRect.left() + 0.5,
++ cursorRect.bottom() - 0.5,
++ cursorRect.right() - 0.5,
++ cursorRect.bottom() - 0.5);
++ painter.drawLine(line);
+
+ } else if (_cursorShape == Enum::IBeamCursor) {
+- painter.drawLine(cursorRect.left(),
+- cursorRect.top(),
+- cursorRect.left(),
+- cursorRect.bottom());
++ QLineF line(cursorRect.left() + 0.5,
++ cursorRect.top() + 0.5,
++ cursorRect.left() + 0.5,
++ cursorRect.bottom() - 0.5);
++ painter.drawLine(line);
+ }
+ }
+
+--
+cgit v1.1
+