public void RefreshWindows(WindowManagerEventArgs args)
        {
            // update screens of stale windows
            if (!EnableService)
            {
                return;
            }

            if (EnableMultiMon)
            {
                foreach (AppBarScreen screen in _windowManager.ScreenState)
                {
                    CairoAppBarWindow window = WindowManager.GetScreenWindow(Windows, screen);

                    if (window != null)
                    {
                        window.Screen = screen;
                        window.SetScreenPosition();
                    }
                }
            }
            else if (Windows.Count > 0)
            {
                Windows[0].Screen = AppBarScreen.FromPrimaryScreen();
                Windows[0].SetScreenPosition();
            }
        }
Example #2
0
        public void ResetPosition()
        {
            double top           = System.Windows.Forms.SystemInformation.WorkingArea.Top / DpiHelper.DpiScale;
            double taskbarHeight = 0;

            if (Settings.Instance.TaskbarMode == 1)
            {
                // special case, since work area is not reduced with this setting
                // this keeps the desktop going beneath the TaskBar

                // get the TaskBar's height
                double             dpiScale     = 1;
                AppBarScreen       screen       = AppBarScreen.FromPrimaryScreen();
                NativeMethods.Rect workAreaRect = _appBarManager.GetWorkArea(ref dpiScale, screen, false, false);
                taskbarHeight = (screen.Bounds.Bottom - workAreaRect.Bottom) / dpiScale;

                // top TaskBar means we should push down
                if (Settings.Instance.TaskbarPosition == 1)
                {
                    top = workAreaRect.Top / dpiScale;
                }
            }

            Width  = WindowManager.PrimaryMonitorWorkArea.Width / DpiHelper.DpiScale;
            Height = (WindowManager.PrimaryMonitorWorkArea.Height / DpiHelper.DpiScale) - taskbarHeight;

            grid.Width  = Width;
            grid.Height = Height;

            Top  = top;
            Left = System.Windows.Forms.SystemInformation.WorkingArea.Left / DpiHelper.DpiScale;
        }
Example #3
0
        private void openTaskbars()
        {
            _screenState = AppBarScreen.FromAllScreens();

            ShellLogger.Debug($"WindowManager: Opening taskbars");

            if (Settings.Instance.ShowMultiMon)
            {
                foreach (var screen in _screenState)
                {
                    openTaskbar(screen);
                }
            }
            else
            {
                openTaskbar(AppBarScreen.FromPrimaryScreen());
            }
        }
Example #4
0
        private void setGridPosition()
        {
            double top  = SystemInformation.WorkingArea.Top / DpiHelper.DpiScale;
            double left = SystemInformation.WorkingArea.Left / DpiHelper.DpiScale;

            if (_desktopManager.ShellWindow != null || _desktopManager.AllowProgmanChild)
            {
                top  = (0 - SystemInformation.VirtualScreen.Top + SystemInformation.WorkingArea.Top) / DpiHelper.DpiScale;
                left = (0 - SystemInformation.VirtualScreen.Left + SystemInformation.WorkingArea.Left) / DpiHelper.DpiScale;
            }

            grid.Width = WindowManager.PrimaryMonitorWorkArea.Width / DpiHelper.DpiScale;

            if (Settings.Instance.TaskbarMode == 1)
            {
                // special case, since work area is not reduced with this setting
                // this keeps the desktop going beneath the TaskBar
                // get the TaskBar's height
                double             dpiScale     = 1;
                AppBarScreen       screen       = AppBarScreen.FromPrimaryScreen();
                NativeMethods.Rect workAreaRect = _appBarManager.GetWorkArea(ref dpiScale, screen, false, false);

                grid.Height = (WindowManager.PrimaryMonitorWorkArea.Height / DpiHelper.DpiScale) - ((screen.Bounds.Bottom - workAreaRect.Bottom) / dpiScale);

                if (Settings.Instance.TaskbarPosition == 1)
                {
                    top += (workAreaRect.Top - SystemInformation.WorkingArea.Top) / dpiScale;
                }
            }
            else
            {
                grid.Height = WindowManager.PrimaryMonitorWorkArea.Height / DpiHelper.DpiScale;
            }

            grid.Margin = new Thickness(left, top, 0, 0);
        }
Example #5
0
 private void openTaskbar()
 {
     _taskbar = new Taskbar(_shellManager, _cloakMonitor, AppBarScreen.FromPrimaryScreen(), AppBarEdge.Bottom);
     _taskbar.Show();
 }
Example #6
0
 public CairoAppBarWindow() : base(null, null, null, AppBarScreen.FromPrimaryScreen(), AppBarEdge.Bottom, 0)
 {
 }