Limitations of Windows wallpaper APIs
t1m0thyj opened this issue · 14 comments
- Wallpaper on lock screen
UserProfilePersonalizationSettings.TrySetLockScreenImageAsync(StorageFile)
- Sets lock screen image correctly the first time it is called
- Fails to update lock screen image afterwards because first image is still cached
- Known issue: https://stackoverflow.com/questions/56935486#comment100576490_56935486
- Different wallpapers on multiple monitors (planned for next version)
IDesktopWallpaper::SetWallpaper
- Monitor ID can be specified to set wallpaper on single monitor
No fade transition so image change is jarring/unnatural
- Different wallpapers on virtual desktops (supported in v4.7.0)
IVirtualDesktopNotification.CurrentVirtualDesktopChanged
Unstable API that broke in Win10 Insiders Preview (Grabacr07/VirtualDesktop#55)Need to investigate this when new APIs are exposed (Grabacr07/VirtualDesktop#57)
No fade transition so image change is jarring/unnatural
This depends on Windows Animate controls and elements
settings
@watermarkhu @7HE-W0R1D Could you please try this build of WDD? It should set the wallpaper across multiple virtual desktops: https://ci.appveyor.com/project/t1m0thyj/windynamicdesktop/builds/39692425/artifacts
Just got some time to try and I installed the UWP version, but it gives me an error when clicking Apply. I've attached the log here.
WinDynamicDesktop.exe.log
Seems that the program treats win11 as an unsupported version so it throws that error?
@t1m0thyj Setting the same theme across multiple desktops works fine on 21H1 (19043). But I'm not sure whether this build already uses the new API. I have left the Dev channel of the insider builds due to stability issues.
I created a new build, could you please try it? I don't know if it'll work on Windows 11, currently the latest version of Windows I have access to test is Windows 10 Insiders (dev edition) and it works there.
I created a new build, could you please try it? I don't know if it'll work on Windows 11, currently the latest version of Windows I have access to test is Windows 10 Insiders (dev edition) and it works there.
@t1m0thyj yes I can confirm this one works on Win 11 ver22000 and all the wallpapers are switching without problems. Thanks for the quick fix!🎉
now it's working, but sometimes i get this error
[2021-06-30 16:53:44.125] System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at WinDynamicDesktop.IVirtualDesktopManagerInternal.GetCurrentDesktop(IntPtr hWndOrMon)
at WinDynamicDesktop.VirtualDesktopApi.SetWallpaper(String imagePath)
at WinDynamicDesktop.WallpaperChangeScheduler.SetWallpaper(Int32 imageId)
at WinDynamicDesktop.WallpaperChangeScheduler.RunScheduler(Boolean forceImageUpdate)
at WinDynamicDesktop.MainMenu.OnRefreshItemClick(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
@0mri Please try again, it should be fixed now: https://ci.appveyor.com/project/t1m0thyj/windynamicdesktop/builds/39839450/artifacts
@t1m0thyj now i get this error when scheduled wallpaper change
[2021-07-02 16:52:40.591] System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at WinDynamicDesktop.IVirtualDesktopManagerInternal.GetCurrentDesktop(IntPtr hWndOrMon)
at WinDynamicDesktop.VirtualDesktopApi.SetWallpaper(String imagePath)
at WinDynamicDesktop.WallpaperApi.<>c__DisplayClass4_0.<SetWallpaper>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
@0mri I now have access to Win11 and think the issue is fixed, could you please try https://ci.appveyor.com/project/t1m0thyj/windynamicdesktop/builds/39873093/artifacts
@t1m0thyj Hi I found this issue from @Grabrcr07's repo.
Windows have been changing interface every half year now, so I strongly suggest that we move to a newer repo like @mntone's instead of manually maintaining those internal interfaces.
And also, @mntone's repo have already added wallpaper support.
@NyaMisty I agree that manually maintaining the internal interfaces is not ideal. Before doing so I attempted to use @mntone's repo, but found that it doesn't work in a Microsoft Store app because it has to compile a DLL the first time it runs on your machine. If there's a way to work around this, I'm definitely open to using the latest fork of the VirtualDesktop package.
Edit: After enabling dynamic code generation for the Microsoft Store app, the VirtualDesktop package is working.
These 3 features have been implemented in WDD v5.