Skip to content

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 change Legacy 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!) 😔, while continuing to have non-double-scaled GTK4 applications

This MR does the following:

  • Renames the ConfigValueProvider::globalScaleFactor() method to x11GlobalScaleFactor()
  • Removes the ConfigValueProvider::globalScaleFactorAsPercent(), ConfigValueProvider::globalScaleFactorFloor() methods as those are now useless
  • The global scale factor for XWayland apps is read from kwinrc under the Xwayland group.
  • Read the base Xft.dpi resource value from the kdeglobals config file

All in all the code is much cleaner, yay! 🙂

CCBUG: 465733
CCBUG: 442901

Edited by Luca Bacci

Merge request reports