From d586a82e37a27cfbc6b3e59de21013c4b24b524f Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Wed, 15 Apr 2020 04:03:06 +0200 Subject: [PATCH] changelog --- Changelog.md | 8 ++++---- mpv.net/WinForms/MainForm.cs | 15 +++++++++------ mpv.net/mpv/mp.cs | 3 ++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Changelog.md b/Changelog.md index 24544fc..9ed119f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,13 +1,13 @@ -5.4.4.3 -======= +5.4.4.3 Beta (not yet released) +============ new --- + - update MediaInfo 20.03 - mpv property window-maximized support added, cycling it from input.conf - might not be 100% reliable, it's likely a bug in the mpv client API and - will be further investigated soon + might not be 100% reliable, use native Windows shortcuts Win+Up, Win+Down ### 5.4.4.2 diff --git a/mpv.net/WinForms/MainForm.cs b/mpv.net/WinForms/MainForm.cs index 42818b1..f4ef592 100644 --- a/mpv.net/WinForms/MainForm.cs +++ b/mpv.net/WinForms/MainForm.cs @@ -13,6 +13,7 @@ using System.Threading.Tasks; using UI; using ScriptHost; +using System.Threading; namespace mpvnet { @@ -24,10 +25,10 @@ namespace mpvnet Point LastCursorPosChanged; int LastCursorChangedTickCount; int TaskbarButtonCreatedMessage; - bool WasShown; DateTime LastCycleFullscreen; Taskbar Taskbar; List RecentFiles; + int ShownTickCount; public MainForm() { @@ -126,6 +127,8 @@ namespace mpvnet BeginInvoke(new Action(() => Text = "mpv.net " + Application.ProductVersion)); } + bool WasShown() => ShownTickCount != 0 && Environment.TickCount > ShownTickCount + 500; + void CM_Popup(object sender, EventArgs e) => CursorHelp.Show(); void VideoSizeChanged() => BeginInvoke(new Action(() => SetFormPosAndSize())); @@ -499,7 +502,7 @@ namespace mpvnet break; case 0x02E0: // WM_DPICHANGED { - if (!WasShown) + if (!WasShown()) break; WinAPI.RECT rect = Marshal.PtrToStructure(m.LParam); @@ -606,13 +609,13 @@ namespace mpvnet void PropChangeWindowMaximized(bool enabled) { - //TODO: this might not be reliable - if (!WasShown) + if (!WasShown()) return; mp.WindowMaximized = enabled; - Invoke(new Action(() => { + BeginInvoke(new Action(() => + { if (mp.WindowMaximized && WindowState != FormWindowState.Maximized) WindowState = FormWindowState.Maximized; else if (!mp.WindowMaximized && WindowState == FormWindowState.Maximized) @@ -678,7 +681,7 @@ namespace mpvnet UpdateCheck.DailyCheck(); mp.LoadScripts(); Task.Run(() => App.Extension = new Extension()); - WasShown = true; + ShownTickCount = Environment.TickCount; } protected override void OnResize(EventArgs e) diff --git a/mpv.net/mpv/mp.cs b/mpv.net/mpv/mp.cs index 1dcacbb..d247e2c 100644 --- a/mpv.net/mpv/mp.cs +++ b/mpv.net/mpv/mp.cs @@ -327,7 +327,7 @@ namespace mpvnet if (WindowHandle == IntPtr.Zero) WindowHandle = FindWindowEx(MainForm.Hwnd, IntPtr.Zero, "mpv", null); - // Debug.WriteLine(evt.event_id.ToString()); + //Debug.WriteLine(evt.event_id.ToString()); try { @@ -436,6 +436,7 @@ namespace mpvnet case mpv_event_id.MPV_EVENT_PROPERTY_CHANGE: { var data = (mpv_event_property)Marshal.PtrToStructure(evt.data, typeof(mpv_event_property)); + //Debug.WriteLine(data.name); if (data.format == mpv_format.MPV_FORMAT_FLAG) {