Skip to content

Commit b25fe52

Browse files
authored
Merge branch 'main' into terminal
2 parents 82e9087 + 0a91823 commit b25fe52

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Files.App/Utils/Global/WallpaperHelpers.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ public static async Task SetAsBackgroundAsync(WallpaperType type, string filePat
1919
{
2020
// Set the desktop background
2121
var wallpaper = (Shell32.IDesktopWallpaper)new Shell32.DesktopWallpaper();
22-
wallpaper.GetMonitorDevicePathAt(0, out var monitorId);
23-
wallpaper.SetWallpaper(monitorId, filePath);
22+
var monitorCount = wallpaper.GetMonitorDevicePathCount();
23+
24+
for (uint i = 0; i < monitorCount; i++)
25+
{
26+
wallpaper.GetMonitorDevicePathAt(i, out var monitorId);
27+
wallpaper.SetWallpaper(monitorId, filePath);
28+
}
2429
}
2530
else if (type == WallpaperType.LockScreen)
2631
{

0 commit comments

Comments
 (0)