Bug 350651 - Konsole has scrolling artifacts if HiDPI screen with scaling in Qt
Summary: Konsole has scrolling artifacts if HiDPI screen with scaling in Qt
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2015-07-27 08:03 UTC by Christoph Cullmann
Modified: 2018-10-20 23:50 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Cullmann 2015-07-27 08:03:01 UTC
On a HiDPI screen if the Qt scaling of output is active, you get ugly scroll artifacts.

A quickfix for this is to disable the shortcut for the scrolling if transparency is on (if you disable transparency on the commandline via --notransparency the same effect is archived).

Hack:

void TerminalDisplay::updateImage()
{
    if (!_screenWindow)
        return;

    // optimization - scroll the existing image where possible and
    // avoid expensive text drawing for parts of the image that
    // can simply be moved up or down
    if (!WindowSystemInfo::HAVE_TRANSPARENCY && _wallpaper->isNull()) {
        scrollImage(_screenWindow->scrollCount() ,
                    _screenWindow->scrollRegion());
        _screenWindow->resetScrollCount();
    }

Could be perhaps improved by checking if scale factor != 1.

Would such a quickfix be acceptable? ATM konsole is not really usable on a hidpi screen with the artifacts ;=)

Reproducible: Always

Steps to Reproduce:
1. export QT_DEVICE_PIXEL_RATIO=2
2. start Konsole (with some recent enough Qt >= 5.4
3. scroll => artefacts

Actual Results:  
Artefacts during scrolling

Expected Results:  
Should just scroll ;=)
Comment 1 Christoph Cullmann 2015-07-27 22:12:51 UTC
Git commit ef1bf9c35ac79c1ba58060723437f25b543a7990 by Christoph Cullmann.
Committed on 27/07/2015 at 22:10.
Pushed by cullmann into branch 'master'.

fix scrolling for a HiDPI setup
this is only a hack but without it, konsole is unusable with pixel scaling on

M  +5    -3    src/TerminalDisplay.cpp

http://commits.kde.org/konsole/ef1bf9c35ac79c1ba58060723437f25b543a7990
Comment 2 Christoph Cullmann 2015-07-27 22:34:37 UTC
Git commit 5a18e2f10785f481e83e107f27b1cccebe99d6d2 by Christoph Cullmann.
Committed on 27/07/2015 at 22:33.
Pushed by cullmann into branch 'Applications/15.08'.

fix scrolling for a HiDPI setup
this is only a hack but without it, konsole is unusable with pixel scaling on

M  +5    -3    src/TerminalDisplay.cpp

http://commits.kde.org/konsole/5a18e2f10785f481e83e107f27b1cccebe99d6d2
Comment 3 Christoph Cullmann 2015-07-27 22:40:05 UTC
Add David CC, he has taken a look at the "hack patch".
It should now be at least "OK" for 15.08 and later without any drawback for non-scaled use cases.
Comment 4 Tsu Jan 2015-12-18 14:55:45 UTC
Is there any report at Qt Bug Tracker? QT_DEVICE_PIXEL_RATIO > 1.0 interferes with transparency in general (artifacts on mouse-over).
Comment 5 Tsu Jan 2015-12-19 10:18:26 UTC
A part of the issue: https://bugreports.qt.io/browse/QTBUG-48116
Comment 6 Martin Sandsmark 2016-08-31 09:33:24 UTC
Do you have a screenshot of the artifacts? I sometimes get artifacts now, it seems like every second row of pixels are offset by a couple of pixels.
Comment 7 lukebenes 2016-12-03 23:42:28 UTC
See also Bug 373232
Comment 8 lukebenes 2016-12-19 05:27:08 UTC
The fractional scaling factor version of this bug was fixed in 

Konsole Version 16.12.0
KDE Frameworks 5.29.0
Qt 5.7.1 (built against 5.7.1)

Although my artifacts seemed slightly different than these artifacts, I think it was the same issue and it has been resolved.
Comment 9 Nate Graham 2017-12-26 15:24:14 UTC
Is this resolved now?
Comment 10 Lieven Tytgat 2018-08-20 13:20:28 UTC
There are still artifacts for general text output in konsole when using scaling with an odd scale factor (1.3 1.5)
However, when using an even scale factor (1.2 1.4) everything is ok.

Hence I would expect this to be a rounding issue?

Hopefully this is helpfull to resolv this issue?
Comment 11 Lieven Tytgat 2018-08-20 13:23:08 UTC
Scaling Factor 1.4 is NOT ok. 1.2 is ok.
Comment 12 Nate Graham 2018-10-20 23:49:54 UTC
OK, the remaining issues are already tracked with Bug 373232 (which we think should be fixed in Qt 5.12). Let's call this fixed since the original bug was about integer HiDPI scale factors.

*** This bug has been marked as a duplicate of bug 373232 ***