Add support for XWayland client scaling
This is very important e.g for Chromium or Electron apps.
How to test:
- Set up a multi monitor system with mixed DPI scaling
- Ensure to run on plasma-workspace tip as of plasma-workspace@cdf2e1a9, or alternatively unset the
GDK_SCALE
,GDK_DPI_SCALE
environment variables when launching test applications.
What to test:
- Test both Plasma/X11 and Plasma/Wayland sessions
- Test the following applications: gtk3-demo-application, gtk4-demo-application, code (or any other Electron app)
- On Wayland, open
System Settings > Display and Monitor > Display Configuration
and changeLegacy Applications (X11)
options
This should fix the regressions introduced by me in 5.27.0 with !49 (merged), which are all about not taking XWayland client scaling in consideration (sorry!)
This MR does the following:
- Renames the
ConfigValueProvider::globalScaleFactor()
method tox11GlobalScaleFactor()
- Removes the
ConfigValueProvider::globalScaleFactorAsPercent()
,ConfigValueProvider::globalScaleFactorFloor()
methods as those are now useless - The global scale factor for XWayland apps is read from
kwinrc
under theXwayland
group. - Read the base
Xft.dpi
resource value from thekdeglobals
config file
All in all the code is much cleaner, yay!
Edited by Luca Bacci