Make video wallpapers survive first contact
Shipping met reality tonight, and reality won three rounds before we did. mpvpaper's -f forks it into the background, which a supervisor reads as instant death — the respawn loop repainted the desktop black once a second. The reaper's own kills fired onExited like crashes, so the supervisor ate its young until deliberate deaths got marked. And the video's path shared wallpaperPath with the still pipeline, whose transactional persistence clobbered it — it now lives under its own videoWallpaperPath key, read by the lock screen and the doctor too. Restore is the service's own now, reactive and once per session: a one-shot timer raced the async preference load and availability probe at cold start and silently lost. A video-wallpaper IPC target drives start/stop/pause from a terminal and from the contract sweep to come. Verified live: one player per output, same PID across restarts, VAAPI engaged, 0.2% CPU steady for 1440p30 h264, pause from the bar pill. Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -128,11 +128,11 @@ Singleton {
|
||||
onTriggered: {
|
||||
if (!root.startupRestoreEnabled)
|
||||
return;
|
||||
// A stored video wallpaper restores through mpvpaper; handing its
|
||||
// path to the hyprpaper transaction would only fail validation.
|
||||
if (DesktopPreferences.get("wallpaperMode") === "single"
|
||||
&& VideoWallpaper.isVideo(root.configured)) {
|
||||
VideoWallpaper.start(root.configured);
|
||||
// A stored video wallpaper restores through mpvpaper — the video
|
||||
// service owns that reactively (VideoWallpaper.tryRestore), so
|
||||
// this only avoids fighting it with a still policy.
|
||||
if (VideoWallpaper.isVideo(String(DesktopPreferences.get("videoWallpaperPath") || ""))) {
|
||||
VideoWallpaper.tryRestore();
|
||||
return;
|
||||
}
|
||||
root.applyCurrentPolicy(false);
|
||||
@@ -398,10 +398,11 @@ Singleton {
|
||||
return false;
|
||||
}
|
||||
root.lastError = "";
|
||||
DesktopPreferences.set("wallpaperMode", "single");
|
||||
DesktopPreferences.set("wallpaperPath", path);
|
||||
DesktopPreferences.set("videoWallpaperPath", path);
|
||||
return true;
|
||||
}
|
||||
if (DesktopPreferences.get("videoWallpaperPath") !== "")
|
||||
DesktopPreferences.set("videoWallpaperPath", "");
|
||||
const effectivePath = path === "" ? root.shippedPath : path;
|
||||
const allowed = root.candidates([]);
|
||||
if (!WallpaperPolicy.validPath(effectivePath, allowed)) {
|
||||
@@ -454,6 +455,7 @@ Singleton {
|
||||
policy.slideshowPath = collection[0] || policy.globalPath;
|
||||
}
|
||||
if (VideoWallpaper.active) {
|
||||
DesktopPreferences.set("videoWallpaperPath", "");
|
||||
VideoWallpaper.stop();
|
||||
root.pendingStillPolicy = policy;
|
||||
stillAfterVideo.restart();
|
||||
|
||||
Reference in New Issue
Block a user