From 54c413e08da3f0c10a54abbcc961f16b32ff0d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= Date: Wed, 23 Jul 2025 14:16:45 -0400 Subject: [PATCH] bug: fixing crash from leaving gui thread --- src/TwitchStreamingTools/Views/WindowsTitleBar.axaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TwitchStreamingTools/Views/WindowsTitleBar.axaml.cs b/src/TwitchStreamingTools/Views/WindowsTitleBar.axaml.cs index f5fc10d..9c6ec29 100644 --- a/src/TwitchStreamingTools/Views/WindowsTitleBar.axaml.cs +++ b/src/TwitchStreamingTools/Views/WindowsTitleBar.axaml.cs @@ -110,7 +110,9 @@ private async void SubscribeToWindowState() { while (hostWindow == null) { hostWindow = VisualRoot as Window; - await Task.Delay(50).ConfigureAwait(false); + + // Need to stay on the GUI thread. + await Task.Delay(50).ConfigureAwait(true); } hostWindow.GetObservable(Window.WindowStateProperty).Subscribe(s => {