private static async Task Main(string[] args) { var displays = DisplayHandler.GetAll(); var width = 0; var height = 0; foreach (var display in displays) { width += display.Width; height += display.Height; } _area = new Rectangle( 0, 0, width, height ); _widgetService = new WidgetService(); await _widgetService.Initialize(); _bufferedGraphicsContext = new BufferedGraphicsContext(); DesktopHandler.Initialize(); var updateTimer = new QueuedTimer(async x => await Update(), UpdateInterval); var renderTimer = new QueuedTimer(async x => await Render(), RenderInterval); GC.KeepAlive(updateTimer); GC.KeepAlive(renderTimer); AppDomain.CurrentDomain.ProcessExit += OnProcessExit; AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; SystemEvents.SessionEnded += OnSessionEnded; new ManualResetEvent(false).WaitOne(); }