mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[Telemetry] Fix show hide events on PT Run cold boot (#12796)
* [Telemetry] fix show hide events on PT Run boot * Fix spellchecker error
This commit is contained in:
@@ -116,6 +116,7 @@ namespace PowerLauncher
|
||||
ListBox.SuggestionsList.PreviewMouseLeftButtonUp += SuggestionsList_PreviewMouseLeftButtonUp;
|
||||
_viewModel.PropertyChanged += ViewModel_PropertyChanged;
|
||||
_viewModel.MainWindowVisibility = Visibility.Collapsed;
|
||||
_viewModel.LoadedAtLeastOnce = true;
|
||||
|
||||
BringProcessToForeground();
|
||||
}
|
||||
|
||||
@@ -376,6 +376,8 @@ namespace PowerLauncher.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadedAtLeastOnce { get; set; }
|
||||
|
||||
private Visibility _visibility;
|
||||
|
||||
public Visibility MainWindowVisibility
|
||||
@@ -390,9 +392,9 @@ namespace PowerLauncher.ViewModel
|
||||
if (_visibility != value)
|
||||
{
|
||||
_visibility = value;
|
||||
OnPropertyChanged(nameof(MainWindowVisibility));
|
||||
}
|
||||
|
||||
if (LoadedAtLeastOnce)
|
||||
{
|
||||
// Don't trigger telemetry on cold boot. Must have been loaded at least once.
|
||||
if (value == Visibility.Visible)
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new LauncherShowEvent());
|
||||
@@ -402,6 +404,10 @@ namespace PowerLauncher.ViewModel
|
||||
PowerToysTelemetry.Log.WriteEvent(new LauncherHideEvent());
|
||||
}
|
||||
}
|
||||
|
||||
OnPropertyChanged(nameof(MainWindowVisibility));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand IgnoreCommand { get; private set; }
|
||||
|
||||
Reference in New Issue
Block a user