Automatic scaling selection

Authored by davidedmundson on Aug 23 2017, 11:16 AM.



The generator code is run by the KDED when we don't have a profile for a
monitor setup.

If we don't have a config this sets the screen scaling to 2 when it has
an DPI > 1.5*normal DPI. The vertical resolution is also checked that it
matches what you'd find on a high resolution screen to hopefully avoid
issues with bogus EDID.

We may need to tweak this heuristic based on feedback, especially when
want to support fractional scaling.

Test Plan

Removed configs.
Laptop screen looked like it should.
Normal screen was 1x

Diff Detail

R104 KScreen
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Plasma. · View Herald TranscriptAug 23 2017, 11:16 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik added inline comments.

My laptop has 230dpi but only a vertical resolution of 1440, so this wouldn't work for me.



sebas added a subscriber: sebas.Aug 24 2017, 9:51 AM

Patch looks fine, other than the heuristics @broulik already pointed out.


Same vertical resolution here, and my hardware is also something that users with normal eyes would like to see scaled. ~1400ish seems a better threshold, I guess?


Unfortunately there's also some screens at 2560x1440 and standard DPI.

I'll change it anyway, it only affects wayland users so we have time to tweak things.

sebas added inline comments.Aug 24 2017, 4:01 PM

But standard DPI will be filtered out with your dpi > 96 check (which we could even make a bit stricter, like dpi > 150 or so...?

broulik added inline comments.Aug 24 2017, 4:04 PM

The sanity check is mostly for screens that report stupid dpi. Unfortunately, we can't serve both cases, so I'd say let's go with >= 1440 resolution and if people using 27" screens end up with huge controls we can still re-evaluate.

Greater *or equal to* plus :)

get a better screen!

broulik accepted this revision.Aug 24 2017, 5:24 PM
This revision is now accepted and ready to land.Aug 24 2017, 5:24 PM
sebas accepted this revision.Aug 24 2017, 6:03 PM
sebas added a comment.Aug 24 2017, 6:05 PM

Be careful pushing, by the way. It seems you've branched this off of my rotationplasmoid branch. Should obviously go into master.

This revision was automatically updated to reflect the committed changes.