From 734505ee7363aa4f873300ffd32e4ebea9ab4ea7 Mon Sep 17 00:00:00 2001 From: Boris Makogonyuk Date: Sun, 13 Dec 2015 21:43:58 +0100 Subject: [PATCH] Bugfix for issue #397 Wallpaper is not cached in Wox's memory, so that the wallpaper file remains unlocked --- Wox/SettingWindow.xaml.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 36e8b7f3a1..f460fb5a73 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -425,7 +425,12 @@ namespace Wox var wallpaper = WallpaperPathRetrieval.GetWallpaperPath(); if (wallpaper != null && File.Exists(wallpaper)) { - var brush = new ImageBrush(new BitmapImage(new Uri(wallpaper))); + var memStream = new MemoryStream(File.ReadAllBytes(wallpaper)); + var bitmap = new BitmapImage(); + bitmap.BeginInit(); + bitmap.StreamSource = memStream; + bitmap.EndInit(); + var brush = new ImageBrush(bitmap); brush.Stretch = Stretch.UniformToFill; PreviewPanel.Background = brush; }