From eddb95e791211680a6d100b49bec7064fa10fd16 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sat, 2 Nov 2019 11:39:15 +0100 Subject: [PATCH] often the OSC was shown when fullscreen was entered --- Changelog.md | 2 ++ mpv.net/WinForms/MainForm.cs | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 83d811e..47d1d60 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,6 @@ +- fix: often the OSC was shown when fullscreen was entered + ### 5.4.3.0 - new: the color themes can now be customized ([manual](https://github.com/stax76/mpv.net/blob/master/Manual.md#color-theme)) diff --git a/mpv.net/WinForms/MainForm.cs b/mpv.net/WinForms/MainForm.cs index 7afb8cb..3654ca0 100644 --- a/mpv.net/WinForms/MainForm.cs +++ b/mpv.net/WinForms/MainForm.cs @@ -10,6 +10,7 @@ using System.ComponentModel; using System.Globalization; using System.Diagnostics; using System.Threading.Tasks; + using UI; namespace mpvnet @@ -23,7 +24,8 @@ namespace mpvnet int LastCursorChangedTickCount; int TaskbarButtonCreatedMessage; bool WasShown; - Taskbar Taskbar; + DateTime LastCycleFullscreen; + Taskbar Taskbar; List RecentFiles; public MainForm() @@ -344,6 +346,7 @@ namespace mpvnet public void CycleFullscreen(bool enabled) { + LastCycleFullscreen = DateTime.Now; mp.Fullscreen = enabled; if (enabled) @@ -469,9 +472,14 @@ namespace mpvnet break; case 0x0200: // WM_MOUSEMOVE { - Point pos = PointToClient(Cursor.Position); - mp.command($"mouse {pos.X} {pos.Y}"); - if (CursorHelp.IsPosDifferent(LastCursorPosChanged)) CursorHelp.Show(); + if ((DateTime.Now - LastCycleFullscreen).TotalMilliseconds > 100) + { + Point pos = PointToClient(Cursor.Position); + mp.command($"mouse {pos.X} {pos.Y}"); + } + + if (CursorHelp.IsPosDifferent(LastCursorPosChanged)) + CursorHelp.Show(); } break; case 0x2a3: // WM_MOUSELEAVE