From a33c2b6f39b5cd610c52179c0917dc29103e8d3b Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 30 Mar 2026 09:51:15 +0300 Subject: [PATCH] Prevent the window manager from being setup more than once. --- ElementX/Sources/Application/Windowing/WindowManager.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ElementX/Sources/Application/Windowing/WindowManager.swift b/ElementX/Sources/Application/Windowing/WindowManager.swift index 0c86af921..8591a370e 100644 --- a/ElementX/Sources/Application/Windowing/WindowManager.swift +++ b/ElementX/Sources/Application/Windowing/WindowManager.swift @@ -39,6 +39,12 @@ class WindowManager: SecureWindowManagerProtocol { } func configure(with windowScene: UIWindowScene) { + // This gets called for all opened windows, we're only interested in the + // first call, for the main window (works with state restoration too). + guard mainWindow == nil else { + return + } + self.windowScene = windowScene mainWindow = windowScene.keyWindow mainWindow.tintColor = .compound.textActionPrimary