private void refreshWindows(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 }; ScreensChanged?.Invoke(this, args); }
private void refreshWindows() { CairoLogger.Instance.Debug("WindowManager: Refreshing screen information for existing windows"); // 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(); } }