From 1e232b5cdc496ee30675abd06d0505a7a9eec44b Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 15 Jan 2020 10:26:46 +0100 Subject: [PATCH 1/3] Adds IsGuiLocked flag in Workbench to handle query locked states Fixes VSTS #984930 - Get to code can be re-entered during new project flow --- .../CommandManager.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs index c1be68eb9e9..6a44d4a8ecf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs @@ -83,8 +83,11 @@ enum JIS_VKS { bool toolbarUpdaterRunning; bool enableToolbarUpdate; int guiLock; + + public bool IsGuiLocked => guiLock > 0; + int lastX, lastY; - + // Fields used to keep track of the application focus bool appHasFocus; Window lastFocused; @@ -932,7 +935,7 @@ public bool UnlockAll () toolbar.SetEnabled (true); } - if (guiLock > 0) + if (IsGuiLocked) guiLock--; return guiLock == 0; } @@ -1591,7 +1594,7 @@ internal bool DispatchCommand (object commandId, object dataItem, object initial RegisterUserInteraction (); - if (guiLock > 0) + if (IsGuiLocked) return false; #if MAC @@ -1841,7 +1844,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo if (IsEnabled) cui.Run (cmdTarget, info.ArrayInfo); if (!info.ArrayInfo.Bypass) { - if (info.DisableOnShellLock && guiLock > 0) + if (info.DisableOnShellLock && IsGuiLocked) info.Enabled = false; handlerFound = true; } @@ -1851,7 +1854,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo if (IsEnabled) cui.Run (cmdTarget, info); if (!info.Bypass) { - if (info.DisableOnShellLock && guiLock > 0) + if (info.DisableOnShellLock && IsGuiLocked) info.Enabled = false; handlerFound = true; } @@ -1903,7 +1906,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo CurrentCommand = null; } - if (info.DisableOnShellLock && guiLock > 0) + if (info.DisableOnShellLock && IsGuiLocked) info.Enabled = false; return info; } From 0124b7b7df4cbbf8e7be846ccde9db4bf4ac89e9 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 15 Jan 2020 12:35:30 +0100 Subject: [PATCH 2/3] Renames IsGuiLocked to IsLocked --- .../MonoDevelop.Components.Commands/CommandManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs index 6a44d4a8ecf..a7f62172c54 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs @@ -84,7 +84,7 @@ enum JIS_VKS { bool enableToolbarUpdate; int guiLock; - public bool IsGuiLocked => guiLock > 0; + public bool IsLocked => guiLock > 0; int lastX, lastY; From 7ac0fcd234542127ff0c794ff47f3a9dc73f0a70 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 15 Jan 2020 12:57:31 +0100 Subject: [PATCH 3/3] Adds missing renames on save --- .../MonoDevelop.Components.Commands/CommandManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs index a7f62172c54..a0581bec8f2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs @@ -935,7 +935,7 @@ public bool UnlockAll () toolbar.SetEnabled (true); } - if (IsGuiLocked) + if (IsLocked) guiLock--; return guiLock == 0; } @@ -1594,7 +1594,7 @@ internal bool DispatchCommand (object commandId, object dataItem, object initial RegisterUserInteraction (); - if (IsGuiLocked) + if (IsLocked) return false; #if MAC @@ -1844,7 +1844,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo if (IsEnabled) cui.Run (cmdTarget, info.ArrayInfo); if (!info.ArrayInfo.Bypass) { - if (info.DisableOnShellLock && IsGuiLocked) + if (info.DisableOnShellLock && IsLocked) info.Enabled = false; handlerFound = true; } @@ -1854,7 +1854,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo if (IsEnabled) cui.Run (cmdTarget, info); if (!info.Bypass) { - if (info.DisableOnShellLock && IsGuiLocked) + if (info.DisableOnShellLock && IsLocked) info.Enabled = false; handlerFound = true; } @@ -1906,7 +1906,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo CurrentCommand = null; } - if (info.DisableOnShellLock && IsGuiLocked) + if (info.DisableOnShellLock && IsLocked) info.Enabled = false; return info; }