From 46ce22db554881a33e553233f3275d8ae8020a60 Mon Sep 17 00:00:00 2001 From: Isaac Daly Date: Tue, 28 May 2024 20:39:25 +1000 Subject: [PATCH] Defer Store initialization --- src/Whim.Bar/BarPlugin.cs | 4 ++-- src/Whim/Context/Context.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Whim.Bar/BarPlugin.cs b/src/Whim.Bar/BarPlugin.cs index a58a731b4..e731188a3 100644 --- a/src/Whim.Bar/BarPlugin.cs +++ b/src/Whim.Bar/BarPlugin.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text.Json; using Windows.Win32.Graphics.Dwm; @@ -44,7 +44,7 @@ public void PostInitialize() foreach (IMonitor monitor in _context.MonitorManager) { BarWindow barWindow = new(_context, _barConfig, monitor); - _monitorBarMap.Add(monitor, barWindow); + _monitorBarMap[monitor] = barWindow; } ShowAll(); diff --git a/src/Whim/Context/Context.cs b/src/Whim/Context/Context.cs index c14467b15..122fec2fe 100644 --- a/src/Whim/Context/Context.cs +++ b/src/Whim/Context/Context.cs @@ -95,7 +95,6 @@ public void Initialize() // Initialize the managers. Logger.Debug("Initializing..."); _internalContext.PreInitialize(); - Store.Initialize(); PluginManager.PreInitialize(); NotificationManager.Initialize(); @@ -103,6 +102,7 @@ public void Initialize() WorkspaceManager.Initialize(); WindowManager.Initialize(); + Store.Initialize(); Butler.Initialize(); WindowManager.PostInitialize();