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_SCALEenvironment 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 Configurationand 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
kwinrcunder theXwaylandgroup. - Read the base
Xft.dpiresource value from thekdeglobalsconfig file
All in all the code is much cleaner, yay!
Edited by Luca Bacci