diff --git a/Apollo/Windows/TrackWindow.cs b/Apollo/Windows/TrackWindow.cs index c816b004..2df1c930 100644 --- a/Apollo/Windows/TrackWindow.cs +++ b/Apollo/Windows/TrackWindow.cs @@ -6,6 +6,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Input; +using Avalonia.Interactivity; using Avalonia.Markup.Xaml; using Avalonia.Media; using Avalonia.Platform; @@ -211,7 +212,10 @@ void Window_KeyDown(object sender, KeyEventArgs e) { this.Focus(); } - void Window_Focus(object sender, PointerPressedEventArgs e) => this.Focus(); + void Window_LostFocus(object sender, RoutedEventArgs e) { + if (FocusManager.Instance.Current?.GetType() == typeof(ComboBox)) + this.Focus(); + } void MoveWindow(object sender, PointerPressedEventArgs e) { if (e.ClickCount == 2) Expand(e); @@ -222,6 +226,8 @@ void MoveWindow(object sender, PointerPressedEventArgs e) { Activate(); } + void Window_Focus(object sender, PointerPressedEventArgs e) => this.Focus(); + void Minimize() => WindowState = WindowState.Minimized; void Expand(PointerEventArgs e) { diff --git a/Apollo/Windows/TrackWindow.xaml b/Apollo/Windows/TrackWindow.xaml index 79db77f2..3e0c1562 100644 --- a/Apollo/Windows/TrackWindow.xaml +++ b/Apollo/Windows/TrackWindow.xaml @@ -7,7 +7,7 @@ Width="600" MinWidth="400" Height="274" MinHeight="274" MaxHeight="274" Opened="Loaded" Closing="Unloaded" - KeyDown="Window_KeyDown" PointerPressed="Window_Focus"> + KeyDown="Window_KeyDown" PointerPressed="Window_Focus" LostFocus="Window_LostFocus">