diff options
author | Lluis Sanchez <llsan@microsoft.com> | 2019-02-21 21:09:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-21 21:09:11 +0300 |
commit | 8e2582c0fc1558364b67502b43d2e6a44ff6bc48 (patch) | |
tree | 04a49b98500f4f4083678ab8fa2312a7f732c511 | |
parent | 85faa645b27bbe9bb26aba186e6fb2e79e785e00 (diff) | |
parent | 72d410b447bc317e1a48c7b2c9f7c23df2fd56bd (diff) |
Merge pull request #7202 from mono/backport-pr-7200-to-release-7.8monodevelop-7.8.1.4
[release-7.8] [Ide] Just let the content GrabFocus when document tab is activated
-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 () |