Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/plugin-qt/wallpapercache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ install(FILES
${MISC_DIR}/deepin-service-plugin@org.deepin.dde.WallpaperCache.service.d/override.conf
DESTINATION lib/systemd/system/deepin-service-plugin@org.deepin.dde.WallpaperCache.service.d/
)
# Pre-generate blur cache for default wallpaper at boot (avoid first-boot cold-start delay)
install(PROGRAMS ${MISC_DIR}/wallpaper-cache-preheat.sh DESTINATION ${CMAKE_INSTALL_LIBDIR}/deepin-service-manager/)
install(FILES ${MISC_DIR}/dde-wallpaper-cache-preheat.service DESTINATION lib/systemd/system/)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The preheat unit is installed but never enabled or linked into a systemd target, so its WantedBy=multi-user.target install hint is not applied and the service does not run on boot. The first-boot blur cache therefore remains cold and the greeter still hits the original D-Bus timeout.

Triggers: On installations that do not provide a separate package preset enabling this unit.

Suggested fix: Install an explicit symlink into multi-user.target.wants, add a package preset, or otherwise enable the unit during installation.

Suggested change
install(FILES ${MISC_DIR}/dde-wallpaper-cache-preheat.service DESTINATION lib/systemd/system/)
install(FILES ${MISC_DIR}/dde-wallpaper-cache-preheat.service DESTINATION lib/systemd/system/)
install(CODE [[
file(MAKE_DIRECTORY "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/systemd/system/multi-user.target.wants")
execute_process(
COMMAND "${CMAKE_COMMAND}" -E create_symlink
../dde-wallpaper-cache-preheat.service
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/systemd/system/multi-user.target.wants/dde-wallpaper-cache-preheat.service"
)
]])

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Pre-generate wallpaper blur cache for default wallpaper
Documentation=https://pms.uniontech.com/bug-view-335593.html
After=dbus.service
Before=display-manager.service
ConditionPathExists=/usr/share/backgrounds/default_background.jpg
ConditionPathExists=!/var/cache/dde-wallpaper-cache/blur

[Service]
Type=oneshot
ExecStart=/usr/lib/deepin-service-manager/wallpaper-cache-preheat.sh
TimeoutStartSec=60
RemainAfterExit=no

[Install]
WantedBy=multi-user.target
29 changes: 29 additions & 0 deletions src/plugin-qt/wallpapercache/misc/wallpaper-cache-preheat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
# Pre-generate blur cache for the default wallpaper to avoid D-Bus
# on-demand activation cold-start delay on first boot.
#
# The wallpapercache plugin (org.deepin.dde.ImageEffect1) is loaded
# on-demand by deepin-service-manager. On a freshly installed system
# the blur cache directory is empty, so the first Get() call must
# cold-start the service AND generate the blur image from scratch,
# which can exceed the greeter client's timeout.
#
# This script triggers the service early in boot (before the display
# manager) so that the blur file is cached on disk by the time the
# greeter requests it. Failures are non-fatal — the greeter will
# still fall back to the original wallpaper.

DEFAULT_WALLPAPER="/usr/share/backgrounds/default_background.jpg"

[ -f "$DEFAULT_WALLPAPER" ] || exit 0

# Trigger D-Bus activation of the wallpapercache plugin and request
# blur generation for the default wallpaper. Use a generous timeout
# (30 s) to accommodate cold-start + image processing on slow hardware.
dbus-send --system --print-reply --reply-timeout=30000 \
--dest=org.deepin.dde.ImageEffect1 \
/org/deepin/dde/ImageEffect1 \
org.deepin.dde.ImageEffect1.Get \
string:"" string:"$DEFAULT_WALLPAPER" >/dev/null 2>&1 || true

exit 0
Loading