Skip to content

Commit

Permalink
v1.0.5.0 src : duplicate layout, scaler and bufixes.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
rocksdanister committed Sep 6, 2020
1 parent 3f7d83b commit cdd1a53
Show file tree
Hide file tree
Showing 48 changed files with 1,723 additions and 494 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ Help translate lively to other languages: <a href="https://github.com/rocksdanis

**_I'm not officially affiliated with Unity technologies, godot, shadertoy;_**
## Download
##### 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)
##### 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)
- [`Download Lively Wallpaper`][direct-full-win32]

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

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

Expand Down
38 changes: 23 additions & 15 deletions src/livelywpf/UserControls/livelysettings/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
<ScrollViewer>
<StackPanel>
<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWallpaperPlayback}"/>

<ComboBox Header="{x:Bind UIText.TitlePerfAppFullScreen}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedAppFullScreenIndex, Mode=TwoWay}">
<ComboBoxItem Content="{x:Bind UIText.TextPerfPause}"/>
<ComboBoxItem Content="{x:Bind UIText.TextPerfNone}"/>
Expand Down Expand Up @@ -118,6 +117,15 @@
<Grid>
<ScrollViewer>
<StackPanel>
<!--<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="Wallpaper Fit"/>-->
<ComboBox Header="{x:Bind UIText.TitleWallpaperFit}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedWallpaperScalingIndex, Mode=TwoWay}">
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitNone}"/>
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitFill}"/>
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitUniform}"/>
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperFitUniformFill}"/>
</ComboBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipWallpaperFit}"/>

<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleInteraction}"/>
<ComboBox Header="{x:Bind UIText.TitleWallpaperInput}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedWallpaperInputMode, Mode=TwoWay}">
<ComboBoxItem Content="{x:Bind UIText.TextWallpaperInputOff}"/>
Expand All @@ -137,20 +145,6 @@
</ComboBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipVideoPlayer}"/>

<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWebBrowser}"/>
<ComboBox Header="{x:Bind UIText.TitleBrowserEngine}" Margin="0,10,0,0" MinWidth="200">
<ComboBoxItem IsSelected="True">CEF</ComboBoxItem>
<ComboBoxItem IsEnabled="False">MS Edge</ComboBoxItem>
</ComboBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserEngine}"/>

<CheckBox Content="{x:Bind UIText.TitleDiskCache}" IsEnabled="False" Margin="0, 5, 0, 0"/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDisCache}"/>

<TextBlock Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleBrowserDebuggingPort}"/>
<TextBox MinWidth="200" HorizontalAlignment="Left" Text="{Binding WebDebuggingPort, Mode=TwoWay}" BeforeTextChanging="TextBox_BeforeTextChanging"></TextBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserDebuggingPort}"/>

<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWallpaperStream}"/>
<ComboBox Header="{x:Bind UIText.TitleWallpaperStreamQuality}" Margin="0,10,0,0" MinWidth="200" SelectedIndex="{Binding SelectedWallpaperStreamQualityIndex, Mode=TwoWay}">
<ComboBoxItem>144p</ComboBoxItem>
Expand All @@ -165,6 +159,20 @@

<CheckBox Content="{x:Bind UIText.TitleDetectWallpaperStream}" IsChecked="{Binding DetectStreamWallpaper, Mode=TwoWay}"/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDetectWallpaperStream}"/>

<TextBlock FontSize="20" Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleWebBrowser}"/>
<ComboBox Header="{x:Bind UIText.TitleBrowserEngine}" Margin="0,10,0,0" MinWidth="200">
<ComboBoxItem IsSelected="True">CEF</ComboBoxItem>
<ComboBoxItem IsEnabled="False">MS Edge</ComboBoxItem>
</ComboBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserEngine}"/>

<CheckBox Content="{x:Bind UIText.TitleDiskCache}" IsEnabled="False" Margin="0, 5, 0, 0"/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDisCache}"/>

<TextBlock Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleBrowserDebuggingPort}"/>
<TextBox MinWidth="200" HorizontalAlignment="Left" Text="{Binding WebDebuggingPort, Mode=TwoWay}" BeforeTextChanging="TextBox_BeforeTextChanging"></TextBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserDebuggingPort}"/>

</StackPanel>
</ScrollViewer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ public class LocalizeText
public string TextDisplayPauseRuleAll { get; set; }
public string TextPauseAlgorithmForeground { get; set; }
public string TextPauseAlgorithmAll { get; set; }

//wallpaper
public string TitleWallpaperFit { get; set; }
public string TipWallpaperFit { get; set; }
public string TextWallpaperFitFill { get; set; }
public string TextWallpaperFitNone { get; set; }
public string TextWallpaperFitUniform { get; set; }
public string TextWallpaperFitUniformFill { get; set; }
public string TitleInteraction { get; set; }
public string TitleWallpaperInput { get; set; }
public string TitleMouseOnDesktop { get; set; }
Expand Down
9 changes: 9 additions & 0 deletions src/livelywpf/libMPVPlayer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ public partial class App : Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
this.SessionEnding += App_SessionEnding;
var wnd = new MainWindow(e.Args);
//SetupUnhandledExceptionLogging();
wnd.Show();
}

private void App_SessionEnding(object sender, SessionEndingCancelEventArgs e)
{
if (e.ReasonSessionEnding == ReasonSessionEnding.Shutdown || e.ReasonSessionEnding == ReasonSessionEnding.Logoff)
{
e.Cancel = true;
}
}

private void SetupUnhandledExceptionLogging()
{
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
Expand Down
32 changes: 28 additions & 4 deletions src/livelywpf/libMPVPlayer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
//using System.Windows.Forms;
using System.Windows.Interop;
using CommandLine;
Expand Down Expand Up @@ -39,6 +40,12 @@ class Options
Default = 0,
HelpText = "ytdl stream quality.")]
public int StreamQuality { get; set; }

[Option("stretch",
Required = false,
Default = 0,
HelpText = "Video Scaling algorithm.")]
public int StretchMode { get; set; }
}

private void RunOptions(Options opts)
Expand All @@ -54,12 +61,8 @@ private void RunOptions(Options opts)
//flags ref: https://mpv.io/manual/master/
//use gpu decoding if preferable.
player.API.SetPropertyString("hwdec", "auto");
player.API.SetPropertyString("keepaspect", "yes");
//Enable Windows screensaver.
player.API.SetPropertyString("stop-screensaver", "no");
//trying new stuff
//player.API.SetPropertyString("ontop", "yes");
//player.API.SetPropertyString("fullscreen", "yes");
//ytdl.
player.EnableYouTubeDl();
YouTubeDlVideoQuality quality = YouTubeDlVideoQuality.Highest;
Expand All @@ -69,6 +72,27 @@ private void RunOptions(Options opts)
}
catch { }
player.YouTubeDlVideoQuality = quality;
//video scaling.
System.Windows.Media.Stretch stretch = (System.Windows.Media.Stretch)opts.StretchMode;
switch (stretch)
{
//I think these are the mpv equivalent scaler settings.
case System.Windows.Media.Stretch.None:
player.API.SetPropertyString("video-unscaled", "yes");
break;
case System.Windows.Media.Stretch.Fill:
player.API.SetPropertyString("keepaspect", "no");
break;
case System.Windows.Media.Stretch.Uniform:
player.API.SetPropertyString("keepaspect", "yes");
break;
case System.Windows.Media.Stretch.UniformToFill:
player.API.SetPropertyString("panscan", "1.0");
break;
default:
player.API.SetPropertyString("keepaspect", "no");
break;
}
//stream/file.
player.Load(opts.FilePath);
player.Resume();
Expand Down
30 changes: 23 additions & 7 deletions src/livelywpf/livelywpf/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,25 @@ protected override void OnStartup(StartupEventArgs e)
Program.WallpaperDir = Program.SettingsVM.Settings.WallpaperDir;
try
{
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "wallpapers"));
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wptmp"));
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wpdata"));
CreateWallpaperDir();
}
catch (Exception ex)
{
Logger.Error("Wallpaper Directory creation fail:" + ex.ToString());
MessageBox.Show(ex.Message, "Error: Failed to create wallpaper folder", MessageBoxButton.OK, MessageBoxImage.Error);
Program.ExitApplication();
Logger.Error("Wallpaper Directory creation fail, falling back to default directory:" + ex.ToString());
Program.SettingsVM.Settings.WallpaperDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Lively Wallpaper", "Library");
Program.SettingsVM.UpdateConfigFile();
try
{
CreateWallpaperDir();
}
catch(Exception ie)
{
Logger.Error("Wallpaper Directory creation failed, Exiting:" + ie.ToString());
MessageBox.Show(ie.Message, "Error: Failed to create wallpaper folder", MessageBoxButton.OK, MessageBoxImage.Error);
Program.ExitApplication();
}
}

//previous installed appversion is different from current instance.
if (!Program.SettingsVM.Settings.AppVersion.Equals(Assembly.GetExecutingAssembly().GetName().Version.ToString(), StringComparison.OrdinalIgnoreCase)
|| Program.SettingsVM.Settings.IsFirstRun)
Expand Down Expand Up @@ -98,7 +107,7 @@ protected override void OnStartup(StartupEventArgs e)
}

/// <summary>
/// Extract default wallpapers.
/// Extract default wallpapers and incremental if any.
/// </summary>
private int ExtractWallpaperBundle()
{
Expand Down Expand Up @@ -132,6 +141,13 @@ private int ExtractWallpaperBundle()
return maxExtracted;
}

private void CreateWallpaperDir()
{
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "wallpapers"));
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wptmp"));
Directory.CreateDirectory(Path.Combine(Program.WallpaperDir, "SaveData", "wpdata"));
}

private void SetupUnhandledExceptionLogging()
{
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
Expand Down
21 changes: 11 additions & 10 deletions src/livelywpf/livelywpf/Core/InputForwarding/RawInputDX.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,28 +180,29 @@ private static void ForwardMessage(int x, int y, int msg, IntPtr wParam)
SetupDesktop.Wallpapers.ForEach(x =>
{
if (x.GetWallpaperType() == WallpaperType.web ||
x.GetWallpaperType() == WallpaperType.webaudio ||
x.GetWallpaperType() == WallpaperType.app ||
x.GetWallpaperType() == WallpaperType.url ||
x.GetWallpaperType() == WallpaperType.bizhawk ||
x.GetWallpaperType() == WallpaperType.unity ||
x.GetWallpaperType() == WallpaperType.godot)
x.GetWallpaperType() == WallpaperType.webaudio ||
x.GetWallpaperType() == WallpaperType.app ||
x.GetWallpaperType() == WallpaperType.url ||
x.GetWallpaperType() == WallpaperType.bizhawk ||
x.GetWallpaperType() == WallpaperType.unity ||
x.GetWallpaperType() == WallpaperType.godot)
{
if (ScreenHelper.ScreenCompare(display, x.GetScreen(), DisplayIdentificationMode.screenLayout))
if (ScreenHelper.ScreenCompare(display, x.GetScreen(), DisplayIdentificationMode.screenLayout) ||
Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.span)
{
//The low-order word specifies the x-coordinate of the cursor, the high-order word specifies the y-coordinate of the cursor.
//ref: https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousemove
UInt32 lParam = (uint)mouse.Y;
uint lParam = Convert.ToUInt32(mouse.Y);
lParam <<= 16;
lParam |= (uint)mouse.X;
lParam |= Convert.ToUInt32(mouse.X);
NativeMethods.PostMessageW(x.GetHWND(), msg, wParam, (IntPtr)lParam);
}
}
});
}
catch (Exception e)
{
Logger.Error(e.ToString());
Logger.Error("Input Forwarding Error:" + e.Message);
}
}

Expand Down
Loading

0 comments on commit cdd1a53

Please sign in to comment.