From c107bd643d2d3c391471f1c1924ec68730465977 Mon Sep 17 00:00:00 2001 From: Sour Date: Sun, 15 Apr 2018 10:52:38 -0400 Subject: [PATCH] Debugger: Lua - Disable double-click to fullscreen when a Lua script is loaded (to prevent switching mode while using a script that uses the mouse buttons) --- GUI.NET/Debugger/DebugWindowManager.cs | 2 ++ GUI.NET/Forms/frmMain.cs | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/GUI.NET/Debugger/DebugWindowManager.cs b/GUI.NET/Debugger/DebugWindowManager.cs index 3befc132..ae064b07 100644 --- a/GUI.NET/Debugger/DebugWindowManager.cs +++ b/GUI.NET/Debugger/DebugWindowManager.cs @@ -11,6 +11,8 @@ namespace Mesen.GUI.Debugger { private static HashSet
_openedWindows = new HashSet(); + public static bool ScriptWindowOpened { get { return _openedWindows.Any(wnd => wnd is frmScript); } } + public static void OpenDebugWindow(DebugWindow window) { Form existingWindow = GetExistingSingleInstanceWindow(window); diff --git a/GUI.NET/Forms/frmMain.cs b/GUI.NET/Forms/frmMain.cs index fd24fae4..382eb050 100644 --- a/GUI.NET/Forms/frmMain.cs +++ b/GUI.NET/Forms/frmMain.cs @@ -805,7 +805,6 @@ namespace Mesen.GUI.Forms private void ToggleFullscreen() { SetFullscreenState(!_fullscreenMode); - mnuFullscreen.Checked = _fullscreenMode; } private void ToggleMaxSpeed() @@ -1163,9 +1162,9 @@ namespace Mesen.GUI.Forms private void ctrlRenderer_DoubleClick(object sender, EventArgs e) { - if(!CursorManager.NeedMouseIcon && !CursorManager.AllowMouseCapture) { + if(!CursorManager.NeedMouseIcon && !CursorManager.AllowMouseCapture && !DebugWindowManager.ScriptWindowOpened) { //Disable double clicking (used to switch to fullscreen mode) when using a mouse-controlled device - SetFullscreenState(!_fullscreenMode); + ToggleFullscreen(); } }