Beispiel #1
0
        public void SelectWindow()
        {
            var window = tabControl.Toplevel as Gtk.Window;

            if (window != null)
            {
                if (window is DockWindow)
                {
                    DesktopService.GrabDesktopFocus(window);
                }

                // Focusing the main window so hide all the autohide pads
                workbench.DockFrame.MinimizeAllAutohidden();

                                #if MAC
                AppKit.NSWindow nswindow = MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow(window);
                if (nswindow != null)
                {
                    nswindow.MakeFirstResponder(nswindow.ContentView);
                    nswindow.MakeKeyAndOrderFront(nswindow);
                }
                                #endif
            }

            // The tab change must be done now to ensure that the content is created
            // before exiting this method.
            tabControl.CurrentTabIndex = tab.Index;
            // Focus the tab in the next iteration since presenting the window may take some time
            Application.Invoke((o, args) => {
                DockNotebook.ActiveNotebook = tabControl;
            });
            ScheduleContentGrabFocus();
        }
Beispiel #2
0
        public void SelectWindow()
        {
            var window = tabControl.Toplevel as Gtk.Window;

            if (window != null)
            {
                if (window is DockWindow)
                {
                    DesktopService.GrabDesktopFocus(window);
                }

                                #if MAC
                AppKit.NSWindow nswindow = MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow(window);
                if (nswindow != null)
                {
                    nswindow.MakeFirstResponder(nswindow.ContentView);
                }
                                #endif
            }

            // The tab change must be done now to ensure that the content is created
            // before exiting this method.
            tabControl.CurrentTabIndex = tab.Index;

            // Focus the tab in the next iteration since presenting the window may take some time
            Application.Invoke(delegate {
                DockNotebook.ActiveNotebook = tabControl;
                DeepGrabFocus(this.ActiveViewContent.Control);
            });
        }
Beispiel #3
0
 public void GrabDesktopFocus()
 {
     DesktopService.GrabDesktopFocus(RootWindow);
 }