mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +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;
|
ListBox.SuggestionsList.PreviewMouseLeftButtonUp += SuggestionsList_PreviewMouseLeftButtonUp;
|
||||||
_viewModel.PropertyChanged += ViewModel_PropertyChanged;
|
_viewModel.PropertyChanged += ViewModel_PropertyChanged;
|
||||||
_viewModel.MainWindowVisibility = Visibility.Collapsed;
|
_viewModel.MainWindowVisibility = Visibility.Collapsed;
|
||||||
|
_viewModel.LoadedAtLeastOnce = true;
|
||||||
|
|
||||||
BringProcessToForeground();
|
BringProcessToForeground();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -376,6 +376,8 @@ namespace PowerLauncher.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool LoadedAtLeastOnce { get; set; }
|
||||||
|
|
||||||
private Visibility _visibility;
|
private Visibility _visibility;
|
||||||
|
|
||||||
public Visibility MainWindowVisibility
|
public Visibility MainWindowVisibility
|
||||||
@@ -390,16 +392,20 @@ namespace PowerLauncher.ViewModel
|
|||||||
if (_visibility != value)
|
if (_visibility != value)
|
||||||
{
|
{
|
||||||
_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());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new LauncherHideEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (value == Visibility.Visible)
|
OnPropertyChanged(nameof(MainWindowVisibility));
|
||||||
{
|
|
||||||
PowerToysTelemetry.Log.WriteEvent(new LauncherShowEvent());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PowerToysTelemetry.Log.WriteEvent(new LauncherHideEvent());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user