[KCM] Limit scale factor increment to 6.25% on X11
ClosedPublic

Authored by ngraham on Oct 2 2019, 8:16 PM.

Details

Summary

Because of the nature of floating point math and various Qt and X11 bugs, limiting the
scale factor increment to 0.0625 (6.25% in percentage form) will improve the display in
many apps.

For more information, see the discussions in https://bugreports.qt.io/browse/QTBUG-66036 and
the following bug reports:
CCBUG: 412447
CCBUG: 390451
CCBUG: 373232

Depends on D24370
Depends on D24371

Test Plan

Diff Detail

Repository
R104 KScreen
Branch
0625-increment-on-x11
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17756
Build 17774: arc lint + arc unit
ngraham created this revision.Oct 2 2019, 8:16 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 2 2019, 8:16 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Oct 2 2019, 8:16 PM

I would just reformulate

"Scale factors are limited to multiples of 6.25% on X11 to minimize visual glitches in applications."

to

"Scale factors are limited to multiples of 6.25% to minimize visual glitches in applications."

I think adding X11 only makes this harder to understand for the users.

ngraham updated this revision to Diff 67226.Oct 2 2019, 9:06 PM

Don't mention X11; it's too nerdy and technical

mart accepted this revision.Oct 16 2019, 9:59 AM
This revision is now accepted and ready to land.Oct 16 2019, 9:59 AM

Actually I would like to expose the fact that we are doing that only on X11. People not knowing what this is can ignore it. Also it is a single factor, not multiple as with multi output DPI scaling on Wayland.

How about:

The global scale factor is limited to multiples of 6.25% to minimize visual glitches in applications on the X11 windowing system.
romangg requested changes to this revision.Oct 16 2019, 2:45 PM
This revision now requires changes to proceed.Oct 16 2019, 2:45 PM
ngraham retitled this revision from [KCM] Limit scale factor increment to 0.0625 on X11 to [KCM] Limit scale factor increment to 6.25% on X11.Oct 16 2019, 2:45 PM
ngraham updated this revision to Diff 68051.Oct 16 2019, 2:46 PM

Update message

romangg accepted this revision.Oct 16 2019, 2:49 PM

Thank you Nate. master branch only.

This revision is now accepted and ready to land.Oct 16 2019, 2:49 PM
This revision was automatically updated to reflect the committed changes.

@cullmann from what I understand, it is related to what you wrote in https://cullmann.io/posts/kde-qt-highdpi-scaling/ ? How is it only related to X11?

Just a small note: we will probably see some platform that do not use IEEE 754 floating points appear in the next years (unums like posit are well positioned to make an entry on the market, together with RISC-V CPUs). Those will have different tradeofs.

On Wayland one seems to always scale up to the next full factor (e.g. 2) and then scale down the rendered stuff via gl to the selected factor (e.g 1.5).

That leads to other issues but doesn't let rounding stuff creep into the rendering via Qt.

For non IEEE stuff: perhaps that will be available in the future, but at the moment all really available RISC-V ISAs provide just IEEE, too.
And staying in some 1/(2^x) range won't hurt any alternative approach I assume.