Repository: microsoft/PowerToys
File: src/modules/launcher/PowerLauncher/MainWindow.xaml.cs (C#)

Code before:
        }

        private void OnSourceInitialized(object sender, EventArgs e)
        {
            // Initialize protected environment variables before register the WindowMessage
            EnvironmentHelper.GetProtectedEnvironmentVariables();

            _hwndSource = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
            _hwndSource.AddHook(ProcessWindowMessages);

            // Call RegisterHotKey only after a window handle can be used, so that a global hotkey can be registered.
            _viewModel.RegisterHotkey(_hwndSource.Handle);
        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            WindowsInteropHelper.DisableControlBox(this);
            InitializePosition();

            SearchBox.QueryTextBox.DataContext = _viewModel;
            SearchBox.QueryTextBox.PreviewKeyDown += Launcher_KeyDown;

            Observable.FromEventPattern<TextChangedEventHandler, TextChangedEventArgs>(
                add => SearchBox.QueryTextBox.TextChanged += add,
                remove => SearchBox.QueryTextBox.TextChanged -= remove)
                    .Throttle(TimeSpan.FromMilliseconds(250))
                    .Do(@event => Dispatcher.Invoke(() => QueryTextBox_TextChanged(@event.Sender, @event.EventArgs)))
                    .Subscribe();

            // Set initial language flow direction
            SearchBox_UpdateFlowDirection();

            // Register language changed event
            InputLanguageManager.Current.InputLanguageChanged += SearchBox_InputLanguageChanged;

            SearchBox.QueryTextBox.Focus();
            SearchBox.QueryTextBox.ControlledElements.Add(ListBox.SuggestionsList);

            ListBox.DataContext = _viewModel;
            ListBox.SuggestionsList.SelectionChanged += SuggestionsList_SelectionChanged;
            ListBox.SuggestionsList.PreviewMouseLeftButtonUp += SuggestionsList_PreviewMouseLeftButtonUp;
            _viewModel.PropertyChanged += ViewModel_PropertyChanged;
            _viewModel.MainWindowVisibility = Visibility.Collapsed;
            _viewModel.LoadedAtLeastOnce = true;

            BringProcessToForeground();
        }

        private void SuggestionsList_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            var result = ((FrameworkElement)e.OriginalSource).DataContext;

Review comment (performance):
Seems a bit to much I think.

We have plugins that return their values in < 1 millisecond and other slow ones need more than 100 milliseconds. Your delay will make showing the results significantl slower and I guess that other users will complaining about that change. Or do I misunderstood the change?

Does this also has impacts on delayed results/plugin queries?

Code after:
        }

        private void OnSourceInitialized(object sender, EventArgs e)
        {
            // Initialize protected environment variables before register the WindowMessage
            EnvironmentHelper.GetProtectedEnvironmentVariables();

            _hwndSource = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
            _hwndSource.AddHook(ProcessWindowMessages);

            // Call RegisterHotKey only after a window handle can be used, so that a global hotkey can be registered.
            _viewModel.RegisterHotkey(_hwndSource.Handle);
        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            WindowsInteropHelper.DisableControlBox(this);
            InitializePosition();

            SearchBox.QueryTextBox.DataContext = _viewModel;
            SearchBox.QueryTextBox.PreviewKeyDown += Launcher_KeyDown;

            Observable.FromEventPattern<TextChangedEventHandler, TextChangedEventArgs>(
                add => SearchBox.QueryTextBox.TextChanged += add,
                remove => SearchBox.QueryTextBox.TextChanged -= remove)
                    .Do(@event => ClearAutoCompleteText((TextBox)@event.Sender))
                    .Throttle(TimeSpan.FromMilliseconds(150))
                    .Do(@event => Dispatcher.InvokeAsync(() => PerformSearchQuery((TextBox)@event.Sender)))
                    .Subscribe();

            // Set initial language flow direction
            SearchBox_UpdateFlowDirection();

            // Register language changed event
            InputLanguageManager.Current.InputLanguageChanged += SearchBox_InputLanguageChanged;

            SearchBox.QueryTextBox.Focus();
            SearchBox.QueryTextBox.ControlledElements.Add(ListBox.SuggestionsList);

            ListBox.DataContext = _viewModel;
            ListBox.SuggestionsList.SelectionChanged += SuggestionsList_SelectionChanged;
            ListBox.SuggestionsList.PreviewMouseLeftButtonUp += SuggestionsList_PreviewMouseLeftButtonUp;
            _viewModel.PropertyChanged += ViewModel_PropertyChanged;
            _viewModel.MainWindowVisibility = Visibility.Collapsed;
            _viewModel.LoadedAtLeastOnce = true;

            BringProcessToForeground();
        }

        private void SuggestionsList_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {