mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix OpenSettings command: ensure Main Window hides before showing Settings
- Call Hide() before scheduling SettingsWindow.Show() to ensure proper visibility state transition - Use Dispatcher.UIThread.Post for showing the new window to avoid focus conflicts
This commit is contained in:
parent
19913fa1e6
commit
2b328e552a
1 changed files with 5 additions and 12 deletions
|
|
@ -214,16 +214,6 @@ public partial class MainViewModel : ObservableObject
|
|||
public void Show()
|
||||
{
|
||||
MainWindowVisibility = true;
|
||||
ShowRequested?.Invoke();
|
||||
Log.Info(ClassName, "Show requested");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide the main window.
|
||||
/// </summary>
|
||||
public void Hide()
|
||||
{
|
||||
MainWindowVisibility = false;
|
||||
QueryText = "";
|
||||
ActiveView = ActiveView.Results;
|
||||
ContextMenu.Clear();
|
||||
|
|
@ -382,8 +372,11 @@ public partial class MainViewModel : ObservableObject
|
|||
public void OpenSettings()
|
||||
{
|
||||
Hide();
|
||||
var settingsWindow = new SettingsWindow();
|
||||
settingsWindow.Show();
|
||||
global::Avalonia.Threading.Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
var settingsWindow = new SettingsWindow();
|
||||
settingsWindow.Show();
|
||||
});
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
|
|
|||
Loading…
Reference in a new issue