[plasma/plasma-workspace] /: libkworkspace: leave the wallpaper lookup to the wallpaper code
Méven Car <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 89df39356c6cb4d45fcd2eba75a1f8bf57a6e2d5 by Méven Car.
Committed on 16/08/2026 at 11:10.
Pushed by meven into branch 'master'.
libkworkspace: leave the wallpaper lookup to the wallpaper code
Asking which wallpaper to fall back on is the one thing here that reaches for
Plasma, for the theme it asks when the packages give no answer, and Plasma
brings Kirigami, Qml and Quick along. Everything else in this library is
session and display management over D-Bus, so a service that suspends the
machine or watches the display order was loading the QML runtime to do it.
The lookup moves next to the wallpaper code that uses it, as a static library
the settings module and the image wallpaper plugin both link, both of which
draw with Plasma anyway. Nothing outside the repository can notice: the header
was never installed.
M +1 -0 kcms/wallpaper/CMakeLists.txt
M +0 -1 kcms/wallpaper/wallpapermodule.cpp
M +0 -4 libkworkspace/CMakeLists.txt
M +13 -0 wallpapers/CMakeLists.txt
R +0 -0 wallpapers/defaultwallpaper.cpp [from: libkworkspace/defaultwallpaper.cpp - 100% similarity]
R +1 -3 wallpapers/defaultwallpaper.h [from: libkworkspace/defaultwallpaper.h - 074% similarity]
M +1 -0 wallpapers/image/plugin/CMakeLists.txt
https://invent.kde.org/plasma/plasma-workspace/-/commit/89df39356c6cb4d45fcd2eba75a1f8bf57a6e2d5
diff --git a/kcms/wallpaper/CMakeLists.txt b/kcms/wallpaper/CMakeLists.txt
index 280277c87c..31b64b2046 100644
--- a/kcms/wallpaper/CMakeLists.txt
+++ b/kcms/wallpaper/CMakeLists.txt
@@ -32,5 +32,6 @@ target_link_libraries(kcm_wallpaper PRIVATE
Plasma::PlasmaQuick
Plasma::Activities
PW::KWorkspace
+ plasma_defaultwallpaper
)
diff --git a/kcms/wallpaper/wallpapermodule.cpp b/kcms/wallpaper/wallpapermodule.cpp
index f89426fc04..5d21c050f6 100644
--- a/kcms/wallpaper/wallpapermodule.cpp
+++ b/kcms/wallpaper/wallpapermodule.cpp
@@ -5,7 +5,6 @@
#include "kcm_wallpaper_debug.h"
#include <QDBusInterface>
#include <QDBusReply>
-#include <defaultwallpaper.h>
#include <outputorderwatcher.h>
#include <KPackage/Package>
diff --git a/libkworkspace/CMakeLists.txt b/libkworkspace/CMakeLists.txt
index 5b5f5a742d..40b6024016 100644
--- a/libkworkspace/CMakeLists.txt
+++ b/libkworkspace/CMakeLists.txt
@@ -11,8 +11,6 @@ set(kworkspace_LIB_SRCS kdisplaymanager.cpp
autostartscriptdesktopfile.h
login1_manager_interface.cpp
login1_manager_interface.h
- defaultwallpaper.cpp
- defaultwallpaper.h
outputorderwatcher.cpp
outputorderwatcher.h
)
@@ -47,8 +45,6 @@ target_link_libraries(kworkspace
KF6::I18n
KF6::WindowSystem
KF6::Service
- KF6::Package
- Plasma::Plasma
)
target_include_directories(kworkspace PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/kworkspace6>" )
diff --git a/wallpapers/CMakeLists.txt b/wallpapers/CMakeLists.txt
index ad0bfe6d4c..c93b5186e5 100644
--- a/wallpapers/CMakeLists.txt
+++ b/wallpapers/CMakeLists.txt
@@ -1,3 +1,16 @@
+# Where the wallpaper to fall back on comes from. Kept out of libkworkspace, whose other users
+# would otherwise link Plasma, and with it the QML runtime, to reach session management.
+add_library(plasma_defaultwallpaper STATIC defaultwallpaper.cpp defaultwallpaper.h)
+set_property(TARGET plasma_defaultwallpaper PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_include_directories(plasma_defaultwallpaper PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
+target_link_libraries(plasma_defaultwallpaper
+ PUBLIC
+ KF6::Package
+ PRIVATE
+ KF6::ConfigCore
+ Plasma::Plasma
+)
+
add_subdirectory(image)
plasma_install_package(color org.kde.color wallpapers wallpaper)
diff --git a/libkworkspace/defaultwallpaper.cpp b/wallpapers/defaultwallpaper.cpp
similarity index 100%
rename from libkworkspace/defaultwallpaper.cpp
rename to wallpapers/defaultwallpaper.cpp
diff --git a/libkworkspace/defaultwallpaper.h b/wallpapers/defaultwallpaper.h
similarity index 74%
rename from libkworkspace/defaultwallpaper.h
rename to wallpapers/defaultwallpaper.h
index ebe7bf2acb..497f4e4ac3 100644
--- a/libkworkspace/defaultwallpaper.h
+++ b/wallpapers/defaultwallpaper.h
@@ -3,8 +3,6 @@
#pragma once
-#include "kworkspace_export.h"
-
#include <KPackage/Package>
namespace DefaultWallpaper
@@ -12,5 +10,5 @@ namespace DefaultWallpaper
/**
* @returns the package containing the default wallpaper
*/
-[[nodiscard]] KWORKSPACE_EXPORT KPackage::Package defaultWallpaperPackage();
+[[nodiscard]] KPackage::Package defaultWallpaperPackage();
} // namespace DefaultWallpaper
diff --git a/wallpapers/image/plugin/CMakeLists.txt b/wallpapers/image/plugin/CMakeLists.txt
index a6db0e4b78..34af597bab 100644
--- a/wallpapers/image/plugin/CMakeLists.txt
+++ b/wallpapers/image/plugin/CMakeLists.txt
@@ -52,6 +52,7 @@ target_link_libraries(plasma_wallpaper_imageplugin_static
PW::LibTaskManager
PW::KWorkspace
KNightTime
+ plasma_defaultwallpaper
)
if(HAVE_KExiv2)