PowerToys: ColorPicker and PT Run take 10 seconds to exit
ℹ Computer information
- PowerToys version: 0.20.1
- PowerToy module: ColorPicker, PT Run
📝 Provide detailed reproduction steps (if any)
- Turn off ColorPicker or PT Run in the Settings
✔️ Expected result
ColorPIcker.exe and PowerLauncher.exe should quit immediately
❌ Actual result
It takes 10 seconds for ColorPIcker.exe or PowerLauncher.exe to quit
Note: the terminateProcess() function:
https://github.com/microsoft/PowerToys/blob/b8b6dbe791fd3eddb25d8712ec03cf2251ed5bf2/src/modules/colorPicker/ColorPicker/dllmain.cpp#L157-L166
always ends up killing the process:
https://github.com/microsoft/PowerToys/blob/b8b6dbe791fd3eddb25d8712ec03cf2251ed5bf2/src/modules/colorPicker/ColorPicker/dllmain.cpp#L164
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (15 by maintainers)
Launcher is always terminated for me when its window is hidden.
EnumWindowsisn’t able to communicate with the launcher process while its window is hidden. I’ve commented out the hiding logic when the window loses focus and couldn’t reproduce the issue anymore. Otherwise, launcher never terminates for me (tried withINFINITEtimout before terminate call) when disabling/exiting PT.I suggest we use named event for that instead of relying on
WM_CLOSE.Another thing, we already react to the process powertoys.exe exit, and rely solely on that technique for ColorPicker/FZE/…/, so I wonder if we should remove the
terminateProcesscall there, and send event only when we disable the module.@arjunbalgovind the logic is in
Launcher::enabled(), but the first problem to fix is that the current disable logic is not working and PT Run gets killed after the timeout expires. There are two scenarios here: 1 - the WM_CLOSE event is not received/processed by PT Run 2 - PT Run processes the event but it takes forever to quitAlso the event should not be sent to all PT Run windows https://github.com/microsoft/PowerToys/blob/b8b6dbe791fd3eddb25d8712ec03cf2251ed5bf2/src/modules/launcher/Microsoft.Launcher/dllmain.cpp#L222-L223 but only to the main one and then return false. And we need to verify if that code does actually work for applications that don’t have a visible window.