Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KScreen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PlasmaPlasma
  • KScreen
  • Merge requests
  • !152

kded: refine initial best scale calculation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Nate Graham requested to merge ngraham/kscreen:refine-best-scale-calculation into master Nov 04, 2022
  • Overview 59
  • Commits 1
  • Pipelines 9
  • Changes 6

Right now the "best scale" calculation returns 2.0 or 1.0 based on a screen's DPI and whether it has 1440 or more vertical pixels. This works but its fairly basic algorithm misses many screens that would benefit from some scaling.

In the messy world we live in, many people have screens with fewer physical pixels than that, and would benefit from scaling. Biological factors in how eyes work cause a screen's ideal scale factor to be based on the physical size of items on screen, which is a function of its distance from the user's eyes and its pixel density. If we know these, we can compute an appropriate scale factor for it.

Unfortunately we can't know how far away the screen is from the user's eyes. As a result, we have to guesstimate based on what type of device it is plus common sense; people tend to use smaller screens closer to their faces. For example, if we know a screen is a built-in laptop screen, its ideal scale factor is slightly smaller than if it were a small desktop screen.

Accordingly, this commit introduces a new calculation that does away with the pixel size limit and attempts to compute an ideal scale based on a screen's device type and DPI. Computed scale factors are rounded to the nearest 25%.

Implements/fixes https://phabricator.kde.org/T13158 FIXED-IN: 5.27

@teams/usability @ratijas @davidedmundson

Test plan

  1. Apply the MR and compile
  2. Move aside ~/.local/share/kscreen/
  3. Reboot and see if the auto-chosen scale for your hardware feels okay
Edited Nov 04, 2022 by Nate Graham
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: refine-best-scale-calculation