From 723005b28f44ae18ee25f327baf2862436cc5088 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sat, 25 Jul 2020 12:45:47 +0200 Subject: [PATCH] fix issue 188 --- Changelog.md | 2 ++ mpv.net/WinForms/MainForm.cs | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index b1ac4c7..1d97c71 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,8 @@ - Support Wheel_Left and Wheel_Right. (arnesacnussem) - Default screen was changed from primary to OS default to start from the same screen where the File Explorer window is located. +- When mpv.net was started maximized and next was invoked then the + window state was changed to normal instead of staying maximized. 5.4.8.2 Beta diff --git a/mpv.net/WinForms/MainForm.cs b/mpv.net/WinForms/MainForm.cs index f349976..246147d 100644 --- a/mpv.net/WinForms/MainForm.cs +++ b/mpv.net/WinForms/MainForm.cs @@ -762,6 +762,9 @@ namespace mpvnet { base.OnShown(e); + if (WindowState == FormWindowState.Maximized) + core.set_property_bool("window-maximized", true); + if (core.GPUAPI == "vulkan") core.ProcessCommandLine(false); @@ -808,16 +811,16 @@ namespace mpvnet { if (WindowState == FormWindowState.Minimized) { - core.set_property_string("window-minimized", "yes"); + core.set_property_bool("window-minimized", true); } else if (WindowState == FormWindowState.Normal) { - core.set_property_string("window-maximized", "no"); - core.set_property_string("window-minimized", "no"); + core.set_property_bool("window-maximized", false); + core.set_property_bool("window-minimized", false); } else if (WindowState == FormWindowState.Maximized) { - core.set_property_string("window-maximized", "yes"); + core.set_property_bool("window-maximized", true); } } }