-
Notifications
You must be signed in to change notification settings - Fork 17
fix: pre-generate blur cache to fix first-boot wallpaper issue #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mhduiy
wants to merge
1
commit into
linuxdeepin:master
Choose a base branch
from
mhduiy:agent/pms-bug-bot/21e5187a97b6
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/plugin-qt/wallpapercache/misc/dde-wallpaper-cache-preheat.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
29
src/plugin-qt/wallpapercache/misc/wallpaper-cache-preheat.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.targetinstall 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.