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..a0581bec8f2 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 IsLocked => 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 (IsLocked) guiLock--; return guiLock == 0; } @@ -1591,7 +1594,7 @@ internal bool DispatchCommand (object commandId, object dataItem, object initial RegisterUserInteraction (); - if (guiLock > 0) + if (IsLocked) 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 && IsLocked) 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 && IsLocked) 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 && IsLocked) info.Enabled = false; return info; }