diff options
author | Greg Munn <gregm@microsoft.com> | 2019-02-21 21:55:07 +0300 |
---|---|---|
committer | Greg Munn <gregm@microsoft.com> | 2019-02-21 21:55:07 +0300 |
commit | 2fd7597f8c46d88bd038d5abef4150a3eaf40d34 (patch) | |
tree | 9f3de5674aa4bea6ec73cc6d8c85b27c435c1144 | |
parent | a9ffb85c73cabe795d6b5045da3a1bb7c0e0f504 (diff) | |
parent | 8e2582c0fc1558364b67502b43d2e6a44ff6bc48 (diff) |
Merge branch 'release-7.8' into release-7.8-xcode10.2monodevelop-7.8.1.7
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs index 784a75520b..eb7e0eb555 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs @@ -262,9 +262,9 @@ namespace MonoDevelop.Ide.Gui { if (subViewToolbar != null) subViewToolbar.Tabs [subViewToolbar.ActiveTab].Activate (); - SelectWindow (); + ScheduleContentGrabFocus (); } - + public void SelectWindow () { var window = tabControl.Toplevel as Gtk.Window; @@ -291,8 +291,21 @@ namespace MonoDevelop.Ide.Gui // Focus the tab in the next iteration since presenting the window may take some time Application.Invoke ((o, args) => { DockNotebook.ActiveNotebook = tabControl; - ActiveViewContent.GrabFocus (); }); + ScheduleContentGrabFocus (); + } + + bool contentGrabFocusScheduled; + void ScheduleContentGrabFocus () + { + if (contentGrabFocusScheduled) + return; + Application.Invoke ((o, args) => { + contentGrabFocusScheduled = false; + if (workbench.ActiveWorkbenchWindow == this) + ActiveViewContent.GrabFocus (); + }); + contentGrabFocusScheduled = true; } public bool CanMoveToNextNotebook () |