Skip to content

Commit 4ce8720

Browse files
committed
v1.0.7 src: Wallpaper preview and fixes
- Wallpaper preview - opens a live preview of the wallpaper in a new window with full input support. - Fixed a bug where it was not possible to customise wallpaper properties of multiple wallpapers in duplicate mode. -Resolved: #127 Fixed a bug where system-traymenu appears on different screen than the one where cursor is present. - Temporarily removed libvlc videoplayer and and disabled Convert to video feature. - Resolved: #125 Installer now checks whether .net core is installed. - Updated some localization texts.
1 parent a647198 commit 4ce8720

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+451
-159
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ Help translate lively to other languages: <a href="https://github.com/rocksdanis
8888

8989
**_I'm not officially affiliated with Unity technologies, godot, shadertoy;_**
9090
## Download
91-
##### Latest version: v1.0.5.0 (Windows 10 1903 or above)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v1.0.5.0)
91+
##### Latest version: v1.0.7.0 (Windows 10 1903 or above)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v1.0.7.0)
9292
- [`Download Lively Wallpaper`][direct-full-win32]
9393

94-
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v1.0.5.0/lively_setup_x86_full_v1050.exe
94+
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v1.0.7.0/lively_setup_x86_full_v1070.exe
9595

9696
**Installer will give Smartscreen warning, [discussion.](https://github.com/rocksdanister/lively/issues/9)**
9797

src/installer/Script.iss

+19-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; https://jrsoftware.org/isinfo.php
33

44
#define MyAppName "Lively Wallpaper"
5-
#define MyAppVersion "1.0.5.0"
5+
#define MyAppVersion "1.0.7.0"
66
#define MyAppPublisher "rocksdanister"
77
#define MyAppURL "https://github.com/rocksdanister/lively"
88
#define MyAppExeName "livelywpf.exe"
@@ -68,6 +68,7 @@ Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType:
6868
[Files]
6969
Source: "VC\VC_redist.x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall
7070
Source: "dotnetcore\windowsdesktop-runtime-3.1.7-win-x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall
71+
Source: "dotnetcore\netcorecheck.exe"; DestDir: {tmp}; Flags: deleteafterinstall
7172

7273
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
7374
Source: "Release\livelywpf.exe"; DestDir: "{app}"; Flags: ignoreversion;
@@ -81,8 +82,7 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de
8182
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall
8283
;skipifsilent
8384
Filename: "{tmp}\VC_redist.x86.exe"; Check: VCRedistNeedsInstall; StatusMsg: Installing Visual Studio Runtime Libraries...
84-
;todo: check if .net core is already installed.
85-
Filename: "{tmp}\windowsdesktop-runtime-3.1.7-win-x86.exe"; StatusMsg: Installing .Net Core 3.1...
85+
Filename: "{tmp}\windowsdesktop-runtime-3.1.7-win-x86.exe"; Check: NetCoreNeedsInstall('3.1.7'); StatusMsg: Installing .Net Core 3.1...
8686

8787
[Code]
8888
var
@@ -213,6 +213,7 @@ begin
213213
end;
214214
215215
//////////////////////////////////////////////////////////////////////
216+
// Uninstaller promts user whether to close lively if running before proceeding.
216217
function InitializeUninstall(): Boolean;
217218
var
218219
ErrorCode: Integer;
@@ -226,3 +227,18 @@ begin
226227
227228
Result := True;
228229
end;
230+
//////////////////////////////////////////////////////////////////////
231+
// Credits: https://github.com/domgho/InnoDependencyInstaller
232+
// NetCoreCheck tool is necessary for detecting if a specific version of .NET Core/.NET 5.0 is installed: https://github.com/dotnet/runtime/issues/36479
233+
// Source code: https://github.com/dotnet/deployment-tools/tree/master/src/clickonce/native/projects/NetCoreCheck
234+
// Download netcorecheck.exe: https://go.microsoft.com/fwlink/?linkid=2135256
235+
// Download netcorecheck_x64.exe: https://go.microsoft.com/fwlink/?linkid=2135504
236+
function NetCoreNeedsInstall(version: String): Boolean;
237+
var
238+
netcoreRuntime: String;
239+
resultCode: Integer;
240+
begin
241+
// Example: 'Microsoft.NETCore.App', 'Microsoft.AspNetCore.App', 'Microsoft.WindowsDesktop.App'
242+
netcoreRuntime := 'Microsoft.WindowsDesktop.App'
243+
Result := not(Exec(ExpandConstant('{tmp}{\}') + 'netcorecheck.exe', netcoreRuntime + ' ' + version, '', SW_HIDE, ewWaitUntilTerminated, resultCode) and (resultCode = 0));
244+
end;

src/livelywpf/UserControls/livelygrid/LivelyGridView.xaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@
6969
<MenuFlyout.Items>
7070
<MenuFlyoutItem x:Name="moreInformation" Text="{x:Bind UIText.TextInformation}" Click="contextMenu_Click"/>
7171
<MenuFlyoutItem x:Name="setWallpaper" Text="{x:Bind UIText.TextSetWallpaper}" Click="contextMenu_Click"/>
72-
<MenuFlyoutItem x:Name="showOnDisk" Text="{x:Bind UIText.TextShowDisk}" Click="contextMenu_Click"/>
72+
<MenuFlyoutItem x:Name="previewWallpaper" Text="{x:Bind UIText.TextPreviewWallpaper}" Click="contextMenu_Click"/>
7373
<MenuFlyoutItem x:Name="customiseWallpaper" Text="{x:Bind UIText.TextCustomise}" Click="contextMenu_Click"/>
74+
<MenuFlyoutItem x:Name="showOnDisk" Text="{x:Bind UIText.TextShowDisk}" Click="contextMenu_Click"/>
7475
<MenuFlyoutItem x:Name="exportWallpaper" Text="{x:Bind UIText.TextExportZip}" Click="contextMenu_Click"/>
75-
<MenuFlyoutItem x:Name="convertVideo" Text="{x:Bind UIText.TextConvertVideo}" Click="contextMenu_Click"/>
76+
<MenuFlyoutItem x:Name="convertVideo" Text="{x:Bind UIText.TextConvertVideo}" Click="contextMenu_Click" IsEnabled="False"/>
7677
<MenuFlyoutItem x:Name="deleteWallpaper" Text="{x:Bind UIText.TextDelete}" Click="contextMenu_Click"/>
7778
</MenuFlyout.Items>
7879
</MenuFlyout>

src/livelywpf/UserControls/livelygrid/LivelyGridView.xaml.cs

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class LocalizeTextGridView
4040
public string TextExportZip { get; set; }
4141
public string TextDelete { get; set; }
4242
public string TextAddWallpaper { get; set; }
43+
public string TextPreviewWallpaper { get; set; }
4344
}
4445

4546
public sealed partial class LivelyGridView : UserControl

src/livelywpf/UserControls/livelysettings/SettingsPage.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
</ComboBox>
168168
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserEngine}"/>
169169

170-
<CheckBox Content="{x:Bind UIText.TitleDiskCache}" IsEnabled="False" Margin="0, 5, 0, 0"/>
170+
<CheckBox Content="{x:Bind UIText.TitleDiskCache}" Margin="0, 5, 0, 0" IsChecked="{Binding CefDiskCache, Mode=TwoWay}" IsEnabled="False"/>
171171
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDisCache}"/>
172172

173173
<TextBlock Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleBrowserDebuggingPort}"/>

src/livelywpf/livelySubProcess/Program.cs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace livelySubProcess
99
/// <summary>
1010
/// Kills external application type wallpapers in the event lively main pgm is killed by taskmanager/other pgms like av software.
1111
/// This is just incase safety, when shutdown properly the "wpItems" list is cleared by lively before exit.
12+
/// The external lively pgms such as livelycefsharp and libmpvplayer etc will close themselves if lively exits without subprocess.
1213
/// </summary>
1314
class Program
1415
{

src/livelywpf/livelywpf/Core/InputForwarding/RawInputDX.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private static void ForwardMessage(int x, int y, int msg, IntPtr wParam)
188188
x.GetWallpaperType() == WallpaperType.godot)
189189
{
190190
if (ScreenHelper.ScreenCompare(display, x.GetScreen(), DisplayIdentificationMode.screenLayout) ||
191-
Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.span)
191+
Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.span)
192192
{
193193
//The low-order word specifies the x-coordinate of the cursor, the high-order word specifies the y-coordinate of the cursor.
194194
//ref: https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousemove

src/livelywpf/livelywpf/Core/SetupDesktop.cs

+15-5
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ public static void SetWallpaper(LibraryModel wp, LivelyScreen targetDisplay)
121121
}
122122

123123
if(wp.LivelyInfo.Type == WallpaperType.web
124-
|| wp.LivelyInfo.Type == WallpaperType.webaudio
125-
|| wp.LivelyInfo.Type == WallpaperType.url)
124+
|| wp.LivelyInfo.Type == WallpaperType.webaudio
125+
|| wp.LivelyInfo.Type == WallpaperType.url)
126126
{
127127
wp.ItemStartup = true;
128128
var item = new WebProcess(wp.FilePath, wp, targetDisplay);
@@ -131,8 +131,8 @@ public static void SetWallpaper(LibraryModel wp, LivelyScreen targetDisplay)
131131
item.Show();
132132
}
133133
if (wp.LivelyInfo.Type == WallpaperType.app
134-
|| wp.LivelyInfo.Type == WallpaperType.godot
135-
|| wp.LivelyInfo.Type == WallpaperType.unity)
134+
|| wp.LivelyInfo.Type == WallpaperType.godot
135+
|| wp.LivelyInfo.Type == WallpaperType.unity)
136136
{
137137
System.Windows.MessageBox.Show("not supported currently");
138138
return;
@@ -217,9 +217,10 @@ public static void SetWallpaper(LibraryModel wp, LivelyScreen targetDisplay)
217217
private static async void SetupDesktop_WallpaperInitialized(object sender, WindowInitializedArgs e)
218218
{
219219
await semaphoreSlimWallpaperInitLock.WaitAsync();
220+
IWallpaper wallpaper = null;
220221
try
221222
{
222-
var wallpaper = (IWallpaper)sender;
223+
wallpaper = (IWallpaper)sender;
223224
wallpapersPending.Remove(wallpaper);
224225
wallpaper.WindowInitialized -= SetupDesktop_WallpaperInitialized;
225226
await System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new ThreadStart(delegate
@@ -310,6 +311,15 @@ private static async void SetupDesktop_WallpaperInitialized(object sender, Windo
310311
MessageBox.Show(e.Error.Message, Properties.Resources.TitleAppName);
311312
}
312313
}
314+
catch(Exception ex)
315+
{
316+
Logger.Error("Core: Failed processing wallpaper: " + ex.ToString());
317+
if(wallpaper != null)
318+
{
319+
wallpaper.Terminate();
320+
}
321+
WallpaperChanged?.Invoke(null, null);
322+
}
313323
finally
314324
{
315325
semaphoreSlimWallpaperInitLock.Release();

src/livelywpf/livelywpf/Core/Wallpapers/WebProcess.cs

+15-35
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Diagnostics;
33
using System.IO;
44
using System.Management;
5+
using System.Text;
56

67
namespace livelywpf.Core
78
{
@@ -42,56 +43,35 @@ public WebProcess(string path, LibraryModel model, LivelyScreen display)
4243
}
4344
}
4445

45-
string cmdArgs;
46-
if (model.LivelyInfo.Type == WallpaperType.web)
46+
StringBuilder cmdArgs = new StringBuilder();
47+
cmdArgs.Append("--url " + "\"" + path + "\"" + " --display " + "\"" + display + "\"");
48+
cmdArgs.Append(model.LivelyInfo.Type == WallpaperType.url ? " --type online" : " --type local" + " --property " + "\"" + LivelyPropertyCopy + "\"");
49+
//Fail to send empty string as arg; "debug" is set as optional variable in cmdline parser library.
50+
if (!string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
4751
{
48-
//Fail to send empty string as arg; "debug" is set as optional variable in cmdline parser library.
49-
if (string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
50-
{
51-
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" +
52-
" --property " + "\"" + LivelyPropertyCopy + "\"";
53-
}
54-
else
55-
{
56-
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" +
57-
" --property " + "\"" + LivelyPropertyCopy + "\"" + " --debug " + Program.SettingsVM.Settings.WebDebugPort;
58-
}
52+
cmdArgs.Append(" --debug " + Program.SettingsVM.Settings.WebDebugPort);
5953
}
60-
else if (model.LivelyInfo.Type == WallpaperType.webaudio)
54+
55+
if (Program.SettingsVM.Settings.CefDiskCache)
6156
{
62-
if (string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
63-
{
64-
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" + " --audio true" +
65-
" --property " + "\"" + LivelyPropertyCopy + "\"";
66-
}
67-
else
68-
{
69-
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" + " --audio true" +
70-
" --property " + "\"" + LivelyPropertyCopy + "\"" + " --debug " + Program.SettingsVM.Settings.WebDebugPort;
71-
}
57+
cmdArgs.Append(" --cache " + "\"" + Path.Combine(Program.AppDataDir, "Cef", "cache", display.DeviceNumber) + "\"");
7258
}
73-
else
59+
60+
if (model.LivelyInfo.Type == WallpaperType.webaudio)
7461
{
75-
if (string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
76-
{
77-
cmdArgs = "--url " + "\"" + path + "\"" + " --type online" + " --display " + "\"" + display + "\"";
78-
}
79-
else
80-
{
81-
cmdArgs = "--url " + "\"" + path + "\"" + " --type online" + " --display " + "\"" + display + "\"" +
82-
" --debug " + Program.SettingsVM.Settings.WebDebugPort;
83-
}
62+
cmdArgs.Append(" --audio true");
8463
}
8564

8665
ProcessStartInfo start = new ProcessStartInfo
8766
{
88-
Arguments = cmdArgs,
67+
Arguments = cmdArgs.ToString(),
8968
FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plugins", "cef", "LivelyCefSharp.exe"),
9069
RedirectStandardInput = true,
9170
RedirectStandardOutput = true,
9271
UseShellExecute = false,
9372
WorkingDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plugins", "cef")
9473
};
74+
cmdArgs.Clear();
9575

9676
Process webProcess = new Process
9777
{

0 commit comments

Comments
 (0)