Skip to content

Commit

Permalink
Register the hotkey after PT Run is initialized (#11858)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykhailopylyp committed Jun 24, 2021
1 parent 0f32e99 commit d7e09e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/modules/launcher/PowerLauncher/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private void OnStartup(object sender, StartupEventArgs e)
bootTime.Stop();
Log.Info(textToLog.ToString(), GetType());
_mainVM.RegisterHotkey();
PowerToysTelemetry.Log.WriteEvent(new LauncherBootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds });
// [Conditional("RELEASE")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ public MainViewModel(PowerToysRunSettings settings)

InitializeKeyCommands();
RegisterResultsUpdatedEvent();
}

if (settings != null && settings.UsePowerToysRunnerKeyboardHook)
public void RegisterHotkey()
{
Log.Info("RegisterHotkey()", GetType());
if (_settings != null && _settings.UsePowerToysRunnerKeyboardHook)
{
NativeEventWaiter.WaitForEventLoop(Constants.PowerLauncherSharedEvent(), OnHotkey);
_hotkeyHandle = 0;
Expand Down

0 comments on commit d7e09e8

Please sign in to comment.