window maximized issue

This commit is contained in:
Frank Skare
2020-04-19 20:14:46 +02:00
parent fee13353ec
commit 5a726a01e0
2 changed files with 13 additions and 6 deletions

View File

@@ -7,7 +7,8 @@
- mpv property `window-maximized` support added, cycling it from input.conf
might not be 100% reliable, use native Windows shortcuts Win+Up, Win+Down
- the mpv.net `start-size` property supports `always` to always remember the window height
- if the window was maximized before fullscreen was entered, it's now set to
maximized after fullscreen was left (it was requested on the tracker)
### 5.4.4.2

View File

@@ -13,7 +13,6 @@ using System.Threading.Tasks;
using UI;
using ScriptHost;
using System.Threading;
namespace mpvnet
{
@@ -371,9 +370,6 @@ namespace mpvnet
{
if (WindowState != FormWindowState.Maximized || FormBorderStyle != FormBorderStyle.None)
{
if (WindowState == FormWindowState.Maximized)
WindowState = FormWindowState.Minimized;
FormBorderStyle = FormBorderStyle.None;
WindowState = FormWindowState.Maximized;
}
@@ -382,7 +378,10 @@ namespace mpvnet
{
if (WindowState == FormWindowState.Maximized && FormBorderStyle == FormBorderStyle.None)
{
WindowState = FormWindowState.Normal;
if (WasMaximized)
WindowState = FormWindowState.Maximized;
else
WindowState = FormWindowState.Normal;
if (mp.Border)
FormBorderStyle = FormBorderStyle.Sizable;
@@ -701,8 +700,15 @@ namespace mpvnet
if (mp.IsLogoVisible)
mp.ShowLogo();
if (WindowState == FormWindowState.Maximized && FormBorderStyle != FormBorderStyle.None)
WasMaximized = true;
else if (WindowState == FormWindowState.Normal && FormBorderStyle != FormBorderStyle.None)
WasMaximized = false;
}
bool WasMaximized;
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);