Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 1e232b5

Browse files
netonjmmonojenkins
authored andcommitted
Adds IsGuiLocked flag in Workbench to handle query locked states
Fixes VSTS #984930 - Get to code can be re-entered during new project flow
1 parent 87f1d0e commit 1e232b5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ enum JIS_VKS {
8383
bool toolbarUpdaterRunning;
8484
bool enableToolbarUpdate;
8585
int guiLock;
86+
87+
public bool IsGuiLocked => guiLock > 0;
88+
8689
int lastX, lastY;
87-
90+
8891
// Fields used to keep track of the application focus
8992
bool appHasFocus;
9093
Window lastFocused;
@@ -932,7 +935,7 @@ public bool UnlockAll ()
932935
toolbar.SetEnabled (true);
933936
}
934937

935-
if (guiLock > 0)
938+
if (IsGuiLocked)
936939
guiLock--;
937940
return guiLock == 0;
938941
}
@@ -1591,7 +1594,7 @@ internal bool DispatchCommand (object commandId, object dataItem, object initial
15911594

15921595
RegisterUserInteraction ();
15931596

1594-
if (guiLock > 0)
1597+
if (IsGuiLocked)
15951598
return false;
15961599

15971600
#if MAC
@@ -1841,7 +1844,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo
18411844
if (IsEnabled)
18421845
cui.Run (cmdTarget, info.ArrayInfo);
18431846
if (!info.ArrayInfo.Bypass) {
1844-
if (info.DisableOnShellLock && guiLock > 0)
1847+
if (info.DisableOnShellLock && IsGuiLocked)
18451848
info.Enabled = false;
18461849
handlerFound = true;
18471850
}
@@ -1851,7 +1854,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo
18511854
if (IsEnabled)
18521855
cui.Run (cmdTarget, info);
18531856
if (!info.Bypass) {
1854-
if (info.DisableOnShellLock && guiLock > 0)
1857+
if (info.DisableOnShellLock && IsGuiLocked)
18551858
info.Enabled = false;
18561859
handlerFound = true;
18571860
}
@@ -1903,7 +1906,7 @@ public CommandInfo GetCommandInfo (object commandId, CommandTargetRoute targetRo
19031906
CurrentCommand = null;
19041907
}
19051908

1906-
if (info.DisableOnShellLock && guiLock > 0)
1909+
if (info.DisableOnShellLock && IsGuiLocked)
19071910
info.Enabled = false;
19081911
return info;
19091912
}

0 commit comments

Comments
 (0)