Skip to content
Merged
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
25 changes: 9 additions & 16 deletions .github/workflows/auto-version-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ jobs:
# ─────────────────────────────────────────────────────────────
# Job 6: 将 main 同步到 pre-publish branches
# 策略1: git merge main -X theirs(全量合并,冲突以 main 为准)
# 策略2: checkout -- <version-files>(fallback,仅同步版本文件
# 策略2: reset --hard origin/main(fallback,冲突无法自动解决时强制覆盖
# ─────────────────────────────────────────────────────────────
sync:
name: Sync Version to Pre-publish Branches
Expand All @@ -562,7 +562,7 @@ jobs:
token: ${{ secrets.RELEASE_PAT }}
fetch-depth: 0

- name: Sync main -> pre-publish branches (merge preferred, fallback file sync)
- name: Sync main -> pre-publish branches (merge with main override on conflict)
shell: powershell
run: |
$newVersion = "${{ needs.prepare.outputs.new_version }}"
Expand Down Expand Up @@ -597,22 +597,15 @@ jobs:
Write-Host "[OK]" -ForegroundColor Green -NoNewline; Write-Host " $branch fully synced with main"
}
else {
# 策略 2(fallback):merge 无法自动解决 → 放弃,仅同步版本文件
Write-Host " [WARN]" -ForegroundColor Yellow -NoNewline; Write-Host " merge has unresolvable conflicts, fallback to file-only sync"
# 策略 2(fallback):merge 无法自动解决 → 放弃,直接 reset --hard 到 main
# 使用 reset --hard 直接移动分支指针,不产生额外 commit,
# 历史看起来如同这次 merge 从未发生,比 git revert 更干净彻底。
Write-Host " [WARN]" -ForegroundColor Yellow -NoNewline; Write-Host " merge has unresolvable conflicts, force-resetting to origin/main"
git merge --abort

git checkout origin/main -- src/VirtualPaper/VirtualPaper.csproj InnoSetup/setup.iss README.md
Write-Host " [OK] version files pulled from origin/main"

git add src/VirtualPaper/VirtualPaper.csproj InnoSetup/setup.iss README.md
$status = git status --porcelain
if ($status) {
git commit -m "[Github CI] chore: sync version $newVersion (fallback) [skip ci]"
git push origin $branch
Write-Host "[WARN]" -ForegroundColor Yellow -NoNewline; Write-Host " $branch version files synced (full merge skipped due to unresolvable conflicts)"
} else {
Write-Host "[SKIP] $branch already at version $newVersion"
}
git reset --hard origin/main
git push --force-with-lease origin $branch
Write-Host "[WARN]" -ForegroundColor Yellow -NoNewline; Write-Host " $branch force-reset to origin/main (unresolvable conflicts overridden)"
}
}

Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/manual-rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ jobs:
Write-Host "[OK]" -ForegroundColor Green -NoNewline; Write-Host " main: version $version reverted"

# ─────────────────────────────────────────────────────────
# Step 2: 在预发布分支上恢复 bump 前的版本文件
# 无论 sync 是 merge 还是 fallback file-sync,统一用
# bump 前的 main 中的版本文件覆盖,确保版本号一致。
# 不 revert 完整的 merge(保留 main 同步过来的代码)。
# Step 2: 在预发布分支上创建一个 revert commit,回滚到 pre-bump 状态
# 做法:用 `git read-tree --reset -u` 将工作树和 index 重置为
# pre-bump main 的内容快照,但 HEAD 保持不变;再 commit & push。
# 效果:
# - 分支内容与 pre-bump main 完全一致(含版本文件等所有文件)
# - 完整保留历史(sync merge / bump commit 都仍在 git log 中)
# - 多一条清晰的 revert commit,可追溯何时回滚到了哪个版本
# - 普通 push 即可,无需 force push
# ─────────────────────────────────────────────────────────
if ($scope -eq 'main only') {
Write-Host ""
Expand All @@ -92,19 +96,18 @@ jobs:

git checkout -B $branch origin/$branch

# 从 bump 前的 main 中提取版本文件,恢复到旧版本号
git checkout $preBumpSha -- src/VirtualPaper/VirtualPaper.csproj InnoSetup/setup.iss README.md
Write-Host " [OK] version files restored from pre-bump main ($($preBumpSha.Substring(0,7)))"

git add src/VirtualPaper/VirtualPaper.csproj InnoSetup/setup.iss README.md
# 将 index 和工作树重置为 pre-bump main 的内容快照(HEAD 不动)
# 这样后续 commit 就是一条"内容 = pre-bump"的 revert commit
git read-tree --reset -u $preBumpSha

$status = git status --porcelain
if ($status) {
git commit -m "[Github CI] rollback: restore version files before $version [skip ci]"
git commit -m "[Github CI] revert: rollback to state before v$version [skip ci]"
git push origin $branch
Write-Host "[OK]" -ForegroundColor Green -NoNewline; Write-Host " $branch: version files rolled back"
Write-Host "[OK]" -ForegroundColor Green -NoNewline
Write-Host " ${branch}: revert commit created (content matches pre-bump main $($preBumpSha.Substring(0,7)), history preserved)"
} else {
Write-Host "[SKIP] $branch: version files unchanged"
Write-Host "[SKIP] ${branch}: already matches pre-bump main, nothing to revert"
}
}
}
Expand Down
103 changes: 73 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,108 @@
[![Documentation](https://img.shields.io/badge/Docs-Wiki-green)](https://github.com/PaperHammer/VirtualPaper/wiki)
[![Issues](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2FPaperHammer%2FVirtualPaper&query=open_issues&label=Issues&color=orange)](https://github.com/PaperHammer/VirtualPaper/issues)

An open-source, free, lightweight wallpaper management software that runs on Windows 10+
An open-source, free, lightweight wallpaper management software for Windows 10+

<img src="/resources/logos/virtualpaper-logo_4380x712_with_bg_with_round40.png" width="657" height="107"/>
<img src="./resources/logos/virtualpaper-logo_4380x712_with_bg_with_round40.png" width="657" height="107"/>

**The required operating environment: .NET 8.0**
> **Runtime requirement:** .NET 8.0

---

## Contents

- [About](#about)
- [Features](#features)
- [AI+](#ai)
- [Download](#download)
- [Support](#support)
- [License](#license)

---

## About

Based on the [XamlNexus](https://github.com/PaperHammer/XamlNexus) and [Lively](https://github.com/rocksdanister/lively)
Built on top of [XamlNexus](https://github.com/PaperHammer/XamlNexus) and [Lively](https://github.com/rocksdanister/lively).

<img src="/resources/library_contents_light.png" width="600" height="338"/>
<img src="./resources/library_contents_light.png" width="600" height="338"/>

---

## Features

The following files are supported:
**Supported file types**

| Wallpaper type | File type |
| -------------- | ------------------------------- |
| Motion Picture | .gif .apng |
| Still image | .jpg .jpeg .bmp .png .svg .webp |
| Video | .mp4 .webm |
| Wallpaper Type | Extensions |
| --------------- | --------------------------------------------------- |
| Still Image | `.jpg` `.jpeg` `.bmp` `.png` `.svg` `.webp` |
| Motion Picture | `.gif` `.apng` |
| Video | `.mp4` `.webm` |
| Web Interactive | `.zip` `.rar` `.7z` |

---

Real-time preview and customize effects
**Real-time preview & effect customization**

<img src="/resources/preview_light.png" width="600" height="328"/>
<img src="./resources/preview_light.png" width="600" height="328"/>

---

The 3D parallax effect that follows the mouse.
**3D parallax follows your mouse**

<img src="/resources/parallax.png" width="400" height="260"/>
<img src="./resources/parallax.png" width="400" height="260"/>

---

Efficient and lightweight rendering capabilities. Supports exporting: PNG, BMP, JPEG, JPEG XR
**Efficient lightweight rendering**

<img src="/resources/creator.png" width="600" height="328"/>
Supports exporting: PNG, BMP, JPEG, JPEG XR

<img src="./resources/creator.png" width="600" height="328"/>

---

Screen saver services that don't rely on Windows
**Independent screen saver**

Screen saver service that does not rely on Windows built-in support.

<img src="/resources/screensaver.png" width="600" height="328"/>
<img src="./resources/screensaver.png" width="600" height="328"/>

---

Quickly set the lock screen background image
**Lock screen background**

<img src="/resources/lock_background.png" width="370" height="400"/>
Quickly set the lock screen background image.

<img src="./resources/lock_background.png" width="370" height="400"/>

---

Many modern theme styles
**Modern theme styles**

<img src="./resources/ui_texture.png" width="700" height="80"/>

<img src="/resources/ui_texture.png" width="700" height="80"/>
---

## AI+

**Image Style Transfer**

Transfer the artistic style of a reference image onto your wallpaper using AI.

<img src="./resources/styly_transfer_exp.png" width="600" height="328"/>

---

**Super Resolution**

AI-powered image enhancement:

- **Clarity Restoration** — sharpen blurry or low-quality images
- **Lossless Upscaling** — increase resolution without losing detail

<img src="./resources/super_resolution_exp.png" width="600" height="328"/>

---

## AI+

Expand All @@ -89,20 +126,26 @@ Enhances your images using AI super-resolution:

## Download

Windows 10.0.19041.0 及以上
Requires **Windows 10 (10.0.19041.0)** or above.

##### [Installer (Windows 10 10.0.19041.0 or above)](https://github.com/PaperHammer/VirtualPaper/releases/latest)
##### [→ Download latest installer](https://github.com/PaperHammer/VirtualPaper/releases/latest)

---

## Support

#### Localization
**Localization**

Found a translation error, or want to add a new language?
[Submit a localization issue →](https://github.com/PaperHammer/VirtualPaper/issues/new?assignees=&labels=Issue-Bug%2CArea-Localization%2CIssue-Translation%2CNeeds-Triage&projects=&template=translation_issue.yml)

Point out translation errors or translations of Virtual Paper into more languages.[head fore..](https://github.com/PaperHammer/VirtualPaper/issues/new?assignees=&labels=Issue-Bug%2CArea-Localization%2CIssue-Translation%2CNeeds-Triage&projects=&template=translation_issue.yml)
**Suggestions & Bug Reports**

#### Suggestions & Bug report
Have a feature idea or found a bug?
[Open an issue →](https://github.com/PaperHammer/VirtualPaper/issues/new?assignees=&labels=Issue-Bug%2CNeeds-Triage&projects=&template=bug_report.yml)

Suggest new features or file bug reports to improve Virtual Paper.[head for..](https://github.com/PaperHammer/VirtualPaper/issues/new?assignees=&labels=Issue-Bug%2CNeeds-Triage&projects=&template=bug_report.yml)
---

## License

Virtual Paper is licensed under [GPL-v3.](https://github.com/PaperHammer/VirtualPaper/blob/main/LICENSE)
VirtualPaper is licensed under [GPL-3.0](https://github.com/PaperHammer/VirtualPaper/blob/main/LICENSE).
9 changes: 9 additions & 0 deletions src/VirtualPaper.Common/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ public enum FileType {
FVideo,
FDesign,
FimageAI,
FWebZip,
}

public enum RuntimeType {
RUnknown,
RImage,
RImage3D,
RVideo,
RWeb,
}

public enum WallpaperCreateType {
Expand Down Expand Up @@ -273,6 +275,13 @@ public Picture3DCostumize() {
}
}

[JsonSerializable(typeof(WebCostumize))]
public partial class WebCostumizeContext : JsonSerializerContext { }
public class WebCostumize : UniverseCostumise {
public WebCostumize() {
}
}

//public class Saturation {
// public string Type { get; init; } = "Slider";
// public string Text { get; init; } = "Saturation";
Expand Down
8 changes: 5 additions & 3 deletions src/VirtualPaper.Common/Runtime/PlayerWeb/Fields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ public static class Fields {
public static string PlaybackChanged { get; } = "playbackChanged";
public static string AudioMuteChanged { get; } = "audioMuteChanged";
public static string PropertyListener { get; } = "propertyListener";
public static string MouseMove { get; } = "mouseMove";
public static string MouseOut { get; } = "mouseOut";
public static string MouseOut { get; } = "mouseOut";
public static string MouseIn { get; } = "mouseIn";
public static string ResourceLoad { get; } = "resourceLoad";
public static string UpdateDimensions { get; } = "updateDimensions";
public static string TimePerception { get; } = "TimePerception";
public static string TimePerception { get; } = "runTimePerception";
public static string StartParallax { get; } = "startParallax";
public static string StopParallax { get; } = "stopParallax";
}
}
9 changes: 9 additions & 0 deletions src/VirtualPaper.Common/Utils/Files/FileFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public static FileType GetRuntimeFileType(string extension) {
[FileType.FVideo] = [".mp4", ".webm"],
[FileType.FDesign] = [FileExtension.FE_Design],
[FileType.FimageAI] = FImageAIExts,
[FileType.FWebZip] = [".zip", ".rar", ".7z"],
};

/// <summary>
Expand Down Expand Up @@ -174,6 +175,14 @@ private record FileSignature(
// Video
new("66747970", FileType.FVideo, [".mp4"], MustStartWith: false), // ftyp 在偏移 4
new("1A45DFA3", FileType.FVideo, [".webm"], MustStartWith: true), // EBML

// Archive (FWebZip)
new("504B0304", FileType.FWebZip, [".zip"], MustStartWith: true), // ZIP local file header
new("504B0506", FileType.FWebZip, [".zip"], MustStartWith: true), // ZIP empty archive (end of central directory)
new("504B0708", FileType.FWebZip, [".zip"], MustStartWith: true), // ZIP spanned archive
new("526172211A07", FileType.FWebZip, [".rar"], MustStartWith: true), // RAR4 (Rar!\x1a\x07)
new("526172211A070100", FileType.FWebZip, [".rar"], MustStartWith: true), // RAR5
new("377ABCAF271C", FileType.FWebZip, [".7z"], MustStartWith: true), // 7z (7z\xbc\xaf\x27\x1c)
];

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/VirtualPaper.Common/Utils/Files/FileUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public static async Task CopyFileAsync(string src, string dest) {
}

public static async Task<string> UpdateFileFolderPathAsync(string sourcefilePath, string sourceFolderPath, string targetFolderPath) {
if (string.IsNullOrEmpty(sourcefilePath)) return string.Empty;
string targetFilePath = sourcefilePath.Replace(sourceFolderPath, targetFolderPath);
await CopyFileAsync(sourcefilePath, targetFilePath);
return targetFilePath;
Expand Down
13 changes: 7 additions & 6 deletions src/VirtualPaper.Common/Utils/IPC/IpcMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public enum MessageType {
cmd_suspend, // 挂起(Pause)
cmd_resume, // 恢复(Play)
cmd_muted,
cmd_update,
cmd_update,
cmd_suspend_parallax,
cmd_resume_parallax,

Expand Down Expand Up @@ -81,11 +81,12 @@ public enum ScreenshotFormat {

[Serializable]
public class VirtualPaperUpdateCmd : IpcMessage {
public string FilePath { get; set; } = string.Empty;
public string RType { get; set; } = string.Empty;
public string WpEffectFilePathTemplate { get; set; } = string.Empty;
public string WpEffectFilePathTemporary { get; set; } = string.Empty;
public string WpEffectFilePathUsing { get; set; } = string.Empty;
//public string FilePath { get; set; } = string.Empty;
//public string RType { get; set; } = string.Empty;
//public string WpEffectFilePathTemplate { get; set; } = string.Empty;
//public string WpEffectFilePathTemporary { get; set; } = string.Empty;
//public string WpEffectFilePathUsing { get; set; } = string.Empty;
public string? Args { get; set; }
public VirtualPaperUpdateCmd() : base(MessageType.cmd_update) { }
}

Expand Down
Loading
Loading