Bug 445081 - Suggestions for a better scaling implementation
Summary: Suggestions for a better scaling implementation
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-06 16:07 UTC by Tom B
Modified: 2021-11-08 21:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom B 2021-11-06 16:07:55 UTC
This is more of a suggestion or idea than a bug report, though it ties into a lot of actual bug reports.

Display scaling causes a number of weird issues. For example:

- A web browser does display a 4k image on a 4k screen if scaling is applied, for example it has to introduce scrollbars and show 1/4 of it at a time rather than the whole image (unless you zoom out, at which point fidelity is lost)

- XWayland applications look blurry

- Games (running in Xwayland) cannot be run at the native resolution 

- Performance issues #424398

- Window painting issues #426045

- Bugs in arbitrary applications #436681 #436615

The old approach, using DPIs works well unless you need to run different scales on different monitors, in which case you're out of luck entirely. The use-case for scaling, therefore, is when someone wants to run multiple monitors at different scales.

I have a couple of suggestions on how to make scaling work better overall for everyone, and significantly reduce the number of bugs average users are likely to encounter caused by scaling.

My first thought was that if more and more people are now on HiDPI displays then make 100% "bigger" and have people on lower DPI monitors choose 50%. So just make 100% scale around larger fonts.

That's not ideal but we can take that a step further. Let users choose what size "100%" is and then scale around *that*.

1. Choose the font DPI based on their primary monitor (and it will work exactly as it does in X11 when setting the font DPI)

2. *Always* run their primary monitor at 100%

3. Apply scaling <> 100% to monitors other than their primary display only.

This way, any of the number of issues introduced by scaling only affect users who:


1. Have more than one monitor

2. Have more than one monitor of different DPIs and apply scaling

3. Care that these bugs appear on secondary displays.


Users with a single display (e.g. a laptop or average desktop user), or users with two matched displays will *never* encounter issues caused by scaling because they will be running at 100%. This approach would significantly reduce the impact of scaling issues for average users, a significant number of people would simply never encounter an issue due to scaling because they are running at 100%. Only users with mismatched displays would ever encounter a problem. 


My second suggestion, which is probably easier to implement and fixes many XWayland issues in one go, is render *all* XWayland windows at 100% scale factor (1:1 pixel mapping) and adjust the font DPI in the XWayland session to match the scale factor of the display. X11 applications already support scaling based on DPI so this should be relatively simple to fix, and will remove all blurry X11 applications, gaming issues, etc in one single fix. For example, if your scale factor is 200% and font DPI is 96, render XWayland windows at 100% (so everything would look "small") but then set the font DPI in the XWayland session to 192. X11 applications already support this so it should be easy to implement.
Comment 1 Nate Graham 2021-11-08 21:16:52 UTC
Unfortunately using DPI/font sizes alone doesn't work as it results in everything which isn't sensitive to DPI/font size winding up too small. For example:
- all bitmap images and graphics
- all icons
- All custom widgets in apps

The XWayland issues mostly just need to be fixed in XWayland, I'm afraid.