Skip to content

Commit cdd1a53

Browse files
committed
v1.0.5.0 src : duplicate layout, scaler and bufixes.
- Wallpaper scalers added for libmpv, wmf and gif wallpapers. - Fixed a bug where if https is not specified, addwallpaper url loader fails. - Resolved: #126 - Wallpaper install restricted to one. Resolved: #124 - Resolved: #123 - Duplicate screen layout implemented. Resolved: #120 - Added Dutch language.
1 parent 3f7d83b commit cdd1a53

Some content is hidden

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

48 files changed

+1723
-494
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.1.0 (Windows 10 1903 or above)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v1.0.1.0)
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)
9292
- [`Download Lively Wallpaper`][direct-full-win32]
9393

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

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

src/livelywpf/UserControls/livelysettings/SettingsPage.xaml

+23-15
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
<ScrollViewer>
7474
<StackPanel>
7575
<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWallpaperPlayback}"/>
76-
7776
<ComboBox Header="{x:Bind UIText.TitlePerfAppFullScreen}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedAppFullScreenIndex, Mode=TwoWay}">
7877
<ComboBoxItem Content="{x:Bind UIText.TextPerfPause}"/>
7978
<ComboBoxItem Content="{x:Bind UIText.TextPerfNone}"/>
@@ -118,6 +117,15 @@
118117
<Grid>
119118
<ScrollViewer>
120119
<StackPanel>
120+
<!--<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="Wallpaper Fit"/>-->
121+
<ComboBox Header="{x:Bind UIText.TitleWallpaperFit}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedWallpaperScalingIndex, Mode=TwoWay}">
122+
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitNone}"/>
123+
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitFill}"/>
124+
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitUniform}"/>
125+
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitUniformFill}"/>
126+
</ComboBox>
127+
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipWallpaperFit}"/>
128+
121129
<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleInteraction}"/>
122130
<ComboBox Header="{x:Bind UIText.TitleWallpaperInput}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedWallpaperInputMode, Mode=TwoWay}">
123131
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperInputOff}"/>
@@ -137,20 +145,6 @@
137145
</ComboBox>
138146
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipVideoPlayer}"/>
139147

140-
<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWebBrowser}"/>
141-
<ComboBox Header="{x:Bind UIText.TitleBrowserEngine}" Margin="0,10,0,0" MinWidth="200">
142-
<ComboBoxItem IsSelected="True">CEF</ComboBoxItem>
143-
<ComboBoxItem IsEnabled="False">MS Edge</ComboBoxItem>
144-
</ComboBox>
145-
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserEngine}"/>
146-
147-
<CheckBox Content="{x:Bind UIText.TitleDiskCache}" IsEnabled="False" Margin="0, 5, 0, 0"/>
148-
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDisCache}"/>
149-
150-
<TextBlock Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleBrowserDebuggingPort}"/>
151-
<TextBox MinWidth="200" HorizontalAlignment="Left" Text="{Binding WebDebuggingPort, Mode=TwoWay}" BeforeTextChanging="TextBox_BeforeTextChanging"></TextBox>
152-
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserDebuggingPort}"/>
153-
154148
<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWallpaperStream}"/>
155149
<ComboBox Header="{x:Bind UIText.TitleWallpaperStreamQuality}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedWallpaperStreamQualityIndex, Mode=TwoWay}">
156150
<ComboBoxItem>144p</ComboBoxItem>
@@ -165,6 +159,20 @@
165159

166160
<CheckBox Content="{x:Bind UIText.TitleDetectWallpaperStream}" IsChecked="{Binding DetectStreamWallpaper, Mode=TwoWay}"/>
167161
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDetectWallpaperStream}"/>
162+
163+
<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWebBrowser}"/>
164+
<ComboBox Header="{x:Bind UIText.TitleBrowserEngine}" Margin="0,10,0,0" MinWidth="200">
165+
<ComboBoxItem IsSelected="True">CEF</ComboBoxItem>
166+
<ComboBoxItem IsEnabled="False">MS Edge</ComboBoxItem>
167+
</ComboBox>
168+
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserEngine}"/>
169+
170+
<CheckBox Content="{x:Bind UIText.TitleDiskCache}" IsEnabled="False" Margin="0, 5, 0, 0"/>
171+
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDisCache}"/>
172+
173+
<TextBlock Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleBrowserDebuggingPort}"/>
174+
<TextBox MinWidth="200" HorizontalAlignment="Left" Text="{Binding WebDebuggingPort, Mode=TwoWay}" BeforeTextChanging="TextBox_BeforeTextChanging"></TextBox>
175+
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserDebuggingPort}"/>
168176

169177
</StackPanel>
170178
</ScrollViewer>

src/livelywpf/UserControls/livelysettings/SettingsPage.xaml.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ public class LocalizeText
6767
public string TextDisplayPauseRuleAll { get; set; }
6868
public string TextPauseAlgorithmForeground { get; set; }
6969
public string TextPauseAlgorithmAll { get; set; }
70-
7170
//wallpaper
71+
public string TitleWallpaperFit { get; set; }
72+
public string TipWallpaperFit { get; set; }
73+
public string TextWallpaperFitFill { get; set; }
74+
public string TextWallpaperFitNone { get; set; }
75+
public string TextWallpaperFitUniform { get; set; }
76+
public string TextWallpaperFitUniformFill { get; set; }
7277
public string TitleInteraction { get; set; }
7378
public string TitleWallpaperInput { get; set; }
7479
public string TitleMouseOnDesktop { get; set; }

src/livelywpf/libMPVPlayer/App.xaml.cs

+9
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,20 @@ public partial class App : Application
1515
{
1616
private void Application_Startup(object sender, StartupEventArgs e)
1717
{
18+
this.SessionEnding += App_SessionEnding;
1819
var wnd = new MainWindow(e.Args);
1920
//SetupUnhandledExceptionLogging();
2021
wnd.Show();
2122
}
2223

24+
private void App_SessionEnding(object sender, SessionEndingCancelEventArgs e)
25+
{
26+
if (e.ReasonSessionEnding == ReasonSessionEnding.Shutdown || e.ReasonSessionEnding == ReasonSessionEnding.Logoff)
27+
{
28+
e.Cancel = true;
29+
}
30+
}
31+
2332
private void SetupUnhandledExceptionLogging()
2433
{
2534
AppDomain.CurrentDomain.UnhandledException += (s, e) =>

src/livelywpf/libMPVPlayer/MainWindow.xaml.cs

+28-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Runtime.InteropServices;
44
using System.Threading.Tasks;
55
using System.Windows;
6+
using System.Windows.Controls;
67
//using System.Windows.Forms;
78
using System.Windows.Interop;
89
using CommandLine;
@@ -39,6 +40,12 @@ class Options
3940
Default = 0,
4041
HelpText = "ytdl stream quality.")]
4142
public int StreamQuality { get; set; }
43+
44+
[Option("stretch",
45+
Required = false,
46+
Default = 0,
47+
HelpText = "Video Scaling algorithm.")]
48+
public int StretchMode { get; set; }
4249
}
4350

4451
private void RunOptions(Options opts)
@@ -54,12 +61,8 @@ private void RunOptions(Options opts)
5461
//flags ref: https://mpv.io/manual/master/
5562
//use gpu decoding if preferable.
5663
player.API.SetPropertyString("hwdec", "auto");
57-
player.API.SetPropertyString("keepaspect", "yes");
5864
//Enable Windows screensaver.
5965
player.API.SetPropertyString("stop-screensaver", "no");
60-
//trying new stuff
61-
//player.API.SetPropertyString("ontop", "yes");
62-
//player.API.SetPropertyString("fullscreen", "yes");
6366
//ytdl.
6467
player.EnableYouTubeDl();
6568
YouTubeDlVideoQuality quality = YouTubeDlVideoQuality.Highest;
@@ -69,6 +72,27 @@ private void RunOptions(Options opts)
6972
}
7073
catch { }
7174
player.YouTubeDlVideoQuality = quality;
75+
//video scaling.
76+
System.Windows.Media.Stretch stretch = (System.Windows.Media.Stretch)opts.StretchMode;
77+
switch (stretch)
78+
{
79+
//I think these are the mpv equivalent scaler settings.
80+
case System.Windows.Media.Stretch.None:
81+
player.API.SetPropertyString("video-unscaled", "yes");
82+
break;
83+
case System.Windows.Media.Stretch.Fill:
84+
player.API.SetPropertyString("keepaspect", "no");
85+
break;
86+
case System.Windows.Media.Stretch.Uniform:
87+
player.API.SetPropertyString("keepaspect", "yes");
88+
break;
89+
case System.Windows.Media.Stretch.UniformToFill:
90+
player.API.SetPropertyString("panscan", "1.0");
91+
break;
92+
default:
93+
player.API.SetPropertyString("keepaspect", "no");
94+
break;
95+
}
7296
//stream/file.
7397
player.Load(opts.FilePath);
7498
player.Resume();

src/livelywpf/livelywpf/App.xaml.cs

+23-7
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,25 @@ protected override void OnStartup(StartupEventArgs e)
4848
Program.WallpaperDir = Program.SettingsVM.Settings.WallpaperDir;
4949
try
5050
{
51-
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "wallpapers"));
52-
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wptmp"));
53-
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wpdata"));
51+
CreateWallpaperDir();
5452
}
5553
catch (Exception ex)
5654
{
57-
Logger.Error("Wallpaper Directory creation fail:" + ex.ToString());
58-
MessageBox.Show(ex.Message, "Error: Failed to create wallpaper folder", MessageBoxButton.OK, MessageBoxImage.Error);
59-
Program.ExitApplication();
55+
Logger.Error("Wallpaper Directory creation fail, falling back to default directory:" + ex.ToString());
56+
Program.SettingsVM.Settings.WallpaperDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Lively Wallpaper", "Library");
57+
Program.SettingsVM.UpdateConfigFile();
58+
try
59+
{
60+
CreateWallpaperDir();
61+
}
62+
catch(Exception ie)
63+
{
64+
Logger.Error("Wallpaper Directory creation failed, Exiting:" + ie.ToString());
65+
MessageBox.Show(ie.Message, "Error: Failed to create wallpaper folder", MessageBoxButton.OK, MessageBoxImage.Error);
66+
Program.ExitApplication();
67+
}
6068
}
69+
6170
//previous installed appversion is different from current instance.
6271
if (!Program.SettingsVM.Settings.AppVersion.Equals(Assembly.GetExecutingAssembly().GetName().Version.ToString(), StringComparison.OrdinalIgnoreCase)
6372
|| Program.SettingsVM.Settings.IsFirstRun)
@@ -98,7 +107,7 @@ protected override void OnStartup(StartupEventArgs e)
98107
}
99108

100109
/// <summary>
101-
/// Extract default wallpapers.
110+
/// Extract default wallpapers and incremental if any.
102111
/// </summary>
103112
private int ExtractWallpaperBundle()
104113
{
@@ -132,6 +141,13 @@ private int ExtractWallpaperBundle()
132141
return maxExtracted;
133142
}
134143

144+
private void CreateWallpaperDir()
145+
{
146+
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "wallpapers"));
147+
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wptmp"));
148+
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wpdata"));
149+
}
150+
135151
private void SetupUnhandledExceptionLogging()
136152
{
137153
AppDomain.CurrentDomain.UnhandledException += (s, e) =>

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

+11-10
Original file line numberDiff line numberDiff line change
@@ -180,28 +180,29 @@ private static void ForwardMessage(int x, int y, int msg, IntPtr wParam)
180180
SetupDesktop.Wallpapers.ForEach(x =>
181181
{
182182
if (x.GetWallpaperType() == WallpaperType.web ||
183-
x.GetWallpaperType() == WallpaperType.webaudio ||
184-
x.GetWallpaperType() == WallpaperType.app ||
185-
x.GetWallpaperType() == WallpaperType.url ||
186-
x.GetWallpaperType() == WallpaperType.bizhawk ||
187-
x.GetWallpaperType() == WallpaperType.unity ||
188-
x.GetWallpaperType() == WallpaperType.godot)
183+
x.GetWallpaperType() == WallpaperType.webaudio ||
184+
x.GetWallpaperType() == WallpaperType.app ||
185+
x.GetWallpaperType() == WallpaperType.url ||
186+
x.GetWallpaperType() == WallpaperType.bizhawk ||
187+
x.GetWallpaperType() == WallpaperType.unity ||
188+
x.GetWallpaperType() == WallpaperType.godot)
189189
{
190-
if (ScreenHelper.ScreenCompare(display, x.GetScreen(), DisplayIdentificationMode.screenLayout))
190+
if (ScreenHelper.ScreenCompare(display, x.GetScreen(), DisplayIdentificationMode.screenLayout) ||
191+
Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.span)
191192
{
192193
//The low-order word specifies the x-coordinate of the cursor, the high-order word specifies the y-coordinate of the cursor.
193194
//ref: https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousemove
194-
UInt32 lParam = (uint)mouse.Y;
195+
uint lParam = Convert.ToUInt32(mouse.Y);
195196
lParam <<= 16;
196-
lParam |= (uint)mouse.X;
197+
lParam |= Convert.ToUInt32(mouse.X);
197198
NativeMethods.PostMessageW(x.GetHWND(), msg, wParam, (IntPtr)lParam);
198199
}
199200
}
200201
});
201202
}
202203
catch (Exception e)
203204
{
204-
Logger.Error(e.ToString());
205+
Logger.Error("Input Forwarding Error:" + e.Message);
205206
}
206207
}
207208

0 commit comments

Comments
 (0)