File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ private void ApplySelectedTheme()
123123 }
124124 else if ( IsLockScreenSelected )
125125 {
126- bool shouldContinue = ThemeDialogUtils . UpdateConfigForLockScreen ( ) ;
126+ bool shouldContinue = ThemeDialogUtils . UpdateConfigForLockScreen ( activeTheme ) ;
127127 if ( ! shouldContinue )
128128 {
129129 return ;
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ internal static void UpdateConfigForDisplay(List<string> activeThemes)
183183 }
184184 }
185185
186- internal static bool UpdateConfigForLockScreen ( )
186+ internal static bool UpdateConfigForLockScreen ( string activeTheme )
187187 {
188188 if ( JsonConfig . settings . lockScreenDisplayIndex != - 1 )
189189 {
@@ -195,6 +195,12 @@ internal static bool UpdateConfigForLockScreen()
195195 return false ;
196196 }
197197 }
198+ else if ( JsonConfig . settings . lockScreenTheme == null && activeTheme != null )
199+ {
200+ MessageDialog . ShowInfo ( _ ( "WinDynamicDesktop cannot change the lock screen image when Windows " +
201+ "Spotlight is enabled. If the lock screen image does not update, navigate to \" Personalization " +
202+ "-> Lock screen\" in Windows settings and check that the lock screen is set to Picture mode." ) ) ;
203+ }
198204
199205 JsonConfig . settings . lockScreenDisplayIndex = - 1 ;
200206 LockScreenChanger . UpdateMenuItems ( ) ;
Original file line number Diff line number Diff line change @@ -92,11 +92,18 @@ public override async void SetLockScreen(string imagePath)
9292
9393 private static Task < Windows . Storage . StorageFile > LoadImageFile ( string imagePath )
9494 {
95- string [ ] pathSegments = imagePath . Split ( Path . DirectorySeparatorChar ) ;
96- var uri = new Uri ( "ms-appdata:///local/themes/" +
97- Uri . EscapeDataString ( pathSegments [ pathSegments . Length - 2 ] ) + "/" +
98- Uri . EscapeDataString ( pathSegments [ pathSegments . Length - 1 ] ) ) ;
99- return Windows . Storage . StorageFile . GetFileFromApplicationUriAsync ( uri ) . AsTask ( ) ;
95+ if ( imagePath . StartsWith ( Environment . CurrentDirectory ) )
96+ {
97+ string [ ] pathSegments = imagePath . Split ( Path . DirectorySeparatorChar ) ;
98+ var uri = new Uri ( "ms-appdata:///local/themes/" +
99+ Uri . EscapeDataString ( pathSegments [ pathSegments . Length - 2 ] ) + "/" +
100+ Uri . EscapeDataString ( pathSegments [ pathSegments . Length - 1 ] ) ) ;
101+ return Windows . Storage . StorageFile . GetFileFromApplicationUriAsync ( uri ) . AsTask ( ) ;
102+ }
103+ else
104+ {
105+ return Windows . Storage . StorageFile . GetFileFromPathAsync ( imagePath ) . AsTask ( ) ;
106+ }
100107 }
101108 }
102109}
You can’t perform that action at this time.
0 commit comments