public void RefreshWindows(WindowManagerEventArgs args) { // update screens of stale windows if (!EnableService) { return; } if (EnableMultiMon) { foreach (Screen 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 = Screen.PrimaryScreen; Windows[0].SetScreenPosition(); } }
private void DwmChanged(object sender, WindowManagerEventArgs e) { if (DesktopWindow != null && AllowProgmanChild) { // When we are a child of progman, we need to handle redrawing when DWM restarts DestroyDesktopWindow(); CreateDesktopWindow(); } }
private void ScreensChanged(object sender, WindowManagerEventArgs e) { if (e.Reason == ScreenSetupReason.DpiChange) { // treat dpi change as display change ResetPosition(true); } else { ResetPosition(e.DisplaysChanged); } }
private void RefreshWindows(ScreenSetupReason reason, bool displaysChanged) { CairoLogger.Instance.Debug("WindowManager: Refreshing screen information for existing windows"); // TODO: Handle these as events in respective classes // update screens of stale windows if (Settings.Instance.EnableMenuBarMultiMon) { foreach (Screen screen in ScreenState) { MenuBar bar = GetScreenWindow(MenuBarWindows, screen); if (bar != null) { bar.Screen = screen; bar.SetScreenPosition(); } } } else if (MenuBarWindows.Count > 0) { MenuBarWindows[0].Screen = Screen.PrimaryScreen; MenuBarWindows[0].SetScreenPosition(); } if (Settings.Instance.EnableTaskbarMultiMon) { foreach (Screen screen in ScreenState) { Taskbar bar = GetScreenWindow(TaskbarWindows, screen); if (bar != null) { bar.Screen = screen; bar.SetScreenPosition(); } } } else if (TaskbarWindows.Count > 0) { TaskbarWindows[0].Screen = Screen.PrimaryScreen; TaskbarWindows[0].SetScreenPosition(); } // notify event subscribers WindowManagerEventArgs args = new WindowManagerEventArgs { DisplaysChanged = displaysChanged, Reason = reason }; ScreensChanged?.Invoke(this, args); }
private void ScreensChanged(object sender, WindowManagerEventArgs e) { ResetPosition(e.DisplaysChanged); }