Exemple #1
0
        public StartupHandler(IScreens screensInfo, IVirtualDesktopCollection virtualDesktops, IContainerNodeCreater containerNodeCreator, IVirtualDesktopCreater virtualDesktopCreator, IScreenNodeCreater screenNodeCreator, ISignalHandler signal, IKeyHandler keyHandler, ICommandHelper commandHelper, IWindowTracker windowTracker, IPInvokeHandler pinvokeHandler)
        {
            this.screensInfo          = screensInfo;
            this.desktops             = virtualDesktops;
            this.containerNodeCreator = containerNodeCreator;
            this.signal          = signal;
            this.keyHandler      = keyHandler;
            this.commandHelper   = commandHelper;
            this.windowTracker   = windowTracker;
            this.pinvokeHandler  = pinvokeHandler;
            this.HandlesToIgnore = new List <IntPtr>();

            var result = screensInfo.AllScreens.GetOrderRect();

            _screens = result.rect.ToArray();

            for (var i = 0; i < desktops.Count; i++)
            {
                var screensToAdd = _screens.Select((rect, i) => screenNodeCreator.Create("Screen" + i, rect, dir: result.direction)).ToArray();
                desktops[i] = virtualDesktopCreator.Create(i, rect: _screens.TotalRect(), dir: result.direction, childs: screensToAdd);
                desktops[i].Hide();
            }

            desktops.Index = 0;
            desktops.ActiveDesktop.Show();
        }
Exemple #2
0
        /// <summary>
        /// This method make sure we do actual init after desktop + screens have been added
        /// </summary>
        /// <param name="execute">something to run after init</param>
        private void DoInit(Action execute)
        {
            if (_haveInit)
            {
                execute?.Invoke();
                return;
            }

            _haveInit = true;
            _parser   = _services.GetRequiredService <MessageParser>();
            _desktops = _services.GetRequiredService <IVirtualDesktopCollection>();
            _parser.PostInit();
            execute?.Invoke();
        }
Exemple #3
0
 public CommandHelper(IVirtualDesktopCollection desktops, IPInvokeHandler pinvokeHandler, ICommandExecutor commandExecutor)
 {
     this.desktops        = desktops;
     this.pinvokeHandler  = pinvokeHandler;
     this.commandExecutor = commandExecutor;
 }
Exemple #4
0
 public void CreateDesktop(int desktops)
 {
     _desktops = new VirtualDesktopCollection(9);
 }