diff --git a/kcms/colors/CMakeLists.txt b/kcms/colors/CMakeLists.txt --- a/kcms/colors/CMakeLists.txt +++ b/kcms/colors/CMakeLists.txt @@ -36,6 +36,7 @@ KF5::KIOCore KF5::CoreAddons KF5::NewStuff + KF5::WindowSystem ) if(X11_FOUND) target_link_libraries(kcolorschemeeditor ${X11_LIBRARIES} Qt5::X11Extras) @@ -76,7 +77,8 @@ KF5::KIOCore KF5::CoreAddons Qt5::DBus - KF5::NewStuff) + KF5::NewStuff + KF5::WindowSystem) if(X11_FOUND) target_link_libraries(kcm_colors ${X11_LIBRARIES} Qt5::X11Extras) diff --git a/kcms/krdb/krdb.cpp b/kcms/krdb/krdb.cpp --- a/kcms/krdb/krdb.cpp +++ b/kcms/krdb/krdb.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include "krdb.h" #if HAVE_X11 @@ -534,8 +535,17 @@ KConfig _cfgfonts( QStringLiteral("kcmfonts") ); KConfigGroup cfgfonts(&_cfgfonts, "General"); - if( cfgfonts.readEntry( "forceFontDPI", 0 ) != 0 ) - contents += "Xft.dpi: " + cfgfonts.readEntry( "forceFontDPI" ) + '\n'; + int dpi; + + //even though this sets up the X rdb, we want to use the value the + //user has set to use when under wayland - as X apps will be scaled by the compositor + if (KWindowSystem::isPlatformWayland()) { + dpi = cfgfonts.readEntry( "forceFontDPIWayland", 0); + } else { + dpi = cfgfonts.readEntry( "forceFontDPI", 0); + } + if( dpi != 0 ) + contents += "Xft.dpi: " + QString::number(dpi) + '\n'; else { KProcess proc;