From da7920beec6e90cb205af620a1029103fcb0991b Mon Sep 17 00:00:00 2001 From: DaZiYuan Date: Sun, 14 Jul 2024 22:59:00 +0800 Subject: [PATCH] release:v3.0.21-alpha.21 --- ...\264\346\226\260\350\256\260\345\275\225.md" | 14 +++++++------- .../Client.App/Client.App.wapproj | 2 +- .../Client.App/Package.appxmanifest | 2 +- .../WallpaperCore/Libs/DesktopHelper.cs | 17 +++++++++++++---- .../WallpaperRenders/VideoRender.cs | 5 ++++- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git "a/docs/2.\346\233\264\346\226\260\350\256\260\345\275\225.md" "b/docs/2.\346\233\264\346\226\260\350\256\260\345\275\225.md" index d8c50a6e..5e32d328 100644 --- "a/docs/2.\346\233\264\346\226\260\350\256\260\345\275\225.md" +++ "b/docs/2.\346\233\264\346\226\260\350\256\260\345\275\225.md" @@ -57,22 +57,21 @@ --- -## v3.0.20-alpha.20 发布日期:待定 +## v3.1.0-beta.0 发布日期:待定 ### 功能 - 社区 - [ ] 投稿 - - [ ] 会员购买 - [ ] 支持 本地html 壁纸 - [ ] 支持 在线网址 壁纸 -- [ ] 播放视频界面显示loading -- [ ] 在线本地预览壁纸(会员) -- [ ] 本地列表中显示下载中进度 +- [ ] 在桌面预览社区壁纸(会员) +- [ ] 本地列表中显示下载中进度 - [ ] 支持 本地html 壁纸 - [ ] 支持 在线网址 壁纸 - [ ] 播放视频界面显示loading -- [ ] 社区详情页打开会偶尔白色主题闪烁 +- [ ] 社区详情页打开会偶尔白色主题闪烁 +- [ ] 壁纸切换增加loading状态,防止快速操作产生bug ### 修复 @@ -81,7 +80,7 @@ --- -## v3.0.21-alpha.21 发布日期:待定 +## v3.0.21-alpha.21 发布日期:2024.7.15 ### 功能 @@ -89,6 +88,7 @@ - [x] 邮箱注册 - [x] 更换邮箱 - [x] 找回密码 + - [x] 会员购买 - [x] 增加打开本地日志目录按钮(方便查找日志,定位bug) - [x] 巨应3社区访问优化(更快,开销也更大了) - [x] 更新mpv播放器到 mpv-x86_64-v3-20240707-git-00f43e0.7z diff --git a/src/giantapp-wallpaper-client/Client.App/Client.App.wapproj b/src/giantapp-wallpaper-client/Client.App/Client.App.wapproj index a9da5943..6a3dd8fd 100644 --- a/src/giantapp-wallpaper-client/Client.App/Client.App.wapproj +++ b/src/giantapp-wallpaper-client/Client.App/Client.App.wapproj @@ -104,7 +104,7 @@ - + diff --git a/src/giantapp-wallpaper-client/Client.App/Package.appxmanifest b/src/giantapp-wallpaper-client/Client.App/Package.appxmanifest index c55aa8c3..be82cd0b 100644 --- a/src/giantapp-wallpaper-client/Client.App/Package.appxmanifest +++ b/src/giantapp-wallpaper-client/Client.App/Package.appxmanifest @@ -10,7 +10,7 @@ + Version="3.0.21.0" /> ms-resource:Resources/PackageDisplayName diff --git a/src/giantapp-wallpaper-client/WallpaperCore/Libs/DesktopHelper.cs b/src/giantapp-wallpaper-client/WallpaperCore/Libs/DesktopHelper.cs index 6798e060..d9aad62f 100644 --- a/src/giantapp-wallpaper-client/WallpaperCore/Libs/DesktopHelper.cs +++ b/src/giantapp-wallpaper-client/WallpaperCore/Libs/DesktopHelper.cs @@ -111,11 +111,20 @@ public static bool SendHandleToDesktopBottom(IntPtr handler, Rectangle? bounds) //先放到屏幕外,防止产生残影 _ = PInvoke.SetWindowPos(hwnd, HWND.Null, -10000, 0, 0, 0, Windows.Win32.UI.WindowsAndMessaging.SET_WINDOW_POS_FLAGS.SWP_NOACTIVATE); - var res = PInvoke.SetParent(hwnd, worker); - if (res == HWND.Null) + var res = HWND.Null; + int attempts = 0; + const int maxAttempts = 50; // 尝试次数 + while (res.IsNull && attempts < maxAttempts) { - //获取错误 - //var test = PInvoke.GetLastError(); + res = PInvoke.SetParent(hwnd, worker); + if (res.IsNull) + { + // 获取错误 + // var test = PInvoke.GetLastError(); + System.Threading.Thread.Sleep(100); // 等待100ms后重试 + } + attempts++; + _logger.Info($"SendHandleToDesktopBottom {handler} worker:{worker} SetParentRes:{res} attempts:{attempts}"); } ////检查parent是否生效 diff --git a/src/giantapp-wallpaper-client/WallpaperCore/WallpaperRenders/VideoRender.cs b/src/giantapp-wallpaper-client/WallpaperCore/WallpaperRenders/VideoRender.cs index ef01fb67..fedd2df7 100644 --- a/src/giantapp-wallpaper-client/WallpaperCore/WallpaperRenders/VideoRender.cs +++ b/src/giantapp-wallpaper-client/WallpaperCore/WallpaperRenders/VideoRender.cs @@ -150,7 +150,10 @@ internal override async Task Play(Wallpaper? wallpaper) { await _playerApi.LaunchAsync(playlistPath); var bounds = WallpaperApi.GetScreen(screenIndex)?.Bounds; - DeskTopHelper.SendHandleToDesktopBottom(_playerApi.MainHandle, bounds); + await Task.Run(() => + { + DeskTopHelper.SendHandleToDesktopBottom(_playerApi.MainHandle, bounds); + }); } else {