From 9d148d0a3ac121980a8fa08d5477d8e24dce9d07 Mon Sep 17 00:00:00 2001 From: Kai Tao <69313318+vanzue@users.noreply.github.com> Date: Wed, 19 Feb 2025 10:03:09 +0800 Subject: [PATCH] Update runner documentation to reflect newest code structure --- doc/devdocs/runner.md | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/doc/devdocs/runner.md b/doc/devdocs/runner.md index f4e5ebb1e2..a0c20be09b 100644 --- a/doc/devdocs/runner.md +++ b/doc/devdocs/runner.md @@ -4,18 +4,10 @@ Contains the executable starting point, initialization code and the list of know #### [`powertoy_module.h`](/src/runner/powertoy_module.h) and [`powertoy_module.cpp`](/src/runner/powertoy_module.cpp) Contains code for initializing and managing the PowerToy modules. `PowertoyModule` is a RAII-style holder for the `PowertoyModuleIface` pointer, which we got by [invoking module DLL's `powertoy_create` function](https://github.com/microsoft/PowerToys/blob/1760af50c8803588cb575167baae0439af38a9c1/src/runner/powertoy_module.cpp#L13-L24). -#### [`powertoys_events.cpp`](/src/runner/powertoys_events.cpp) -Contains code that handles the various events listeners, and forwards those events to the PowerToys modules. You can learn more about the current event architecture in [shared hooks](/doc/devdocs/shared-hooks.md). - -#### [`lowlevel_keyboard_event.cpp`](/src/runner/lowlevel_keyboard_event.cpp) -Contains code for registering the low level keyboard event hook that listens for keyboard events. Please note that `signal_event` is called from the main thread for this event. - -#### [`win_hook_event.cpp`](/src/runner/win_hook_event.cpp) -Contains code for registering a Windows event hook through `SetWinEventHook`, that listens for various events raised when a window is interacted with. Please note, that `signal_event` is called from a separate `dispatch_thread_proc` worker thread, so you must provide thread-safety for your `signal_event` if you intend to receive it. This is a subject to change. - #### [`tray_icon.cpp`](/src/runner/tray_icon.cpp) Contains code for managing the PowerToys tray icon and its menu commands. Note that `dispatch_run_on_main_ui_thread` is used to transfer received json message from the [Settings window](/doc/devdocs/settings.md) to the main thread, since we're communicating with it from [a dedicated thread](https://github.com/microsoft/PowerToys/blob/7357e40d3f54de51176efe54fda6d57028837b8c/src/runner/settings_window.cpp#L267-L271). + #### [`settings_window.cpp`](/src/runner/settings_window.cpp) Contains code for starting the PowerToys settings window and communicating with it. Settings window is a separate process, so we're using [Windows pipes](https://learn.microsoft.com/windows/win32/ipc/pipes) as a transport for json messages. @@ -33,3 +25,24 @@ Contains code for telemetry. #### [`svgs`](/src/runner/svgs/) Contains the SVG assets used by the PowerToys modules. + +#### [`bug_report.cpp`](/src/runner/bug_report.cpp) +Contains logic to start bug report tool. + +#### [`centralized_hotkeys.cpp`](/src/runner/centralized_hotkeys.cpp) +Contains hot key logic registration and un-registration. + +#### [`centralized_kb_hook.cpp`](/src/runner/centralized_kb_hook.cpp) +Contains logic to handle PowerToys' keyboard shortcut functionality. + +#### [`restart_elevated.cpp`](/src/runner/restart_elevated.cpp) +Contains logic for restarting the current process with different elevation levels. + +#### [`RestartManagement.cpp`](/src/runner/RestartManagement.cpp) +Contains code for restarting a process. + +#### [`settings_telemetry.cpp`](/src/runner/settings_telemetry.cpp) +Contains logic that periodically triggers module-specific setting's telemetry delivery and manages timing and error handling for the process. + +#### [`UpdateUtils.cpp`](/src/runner/UpdateUtils.cpp) +Contains code to handle the automatic update checking, notification, and installation process for PowerToys. \ No newline at end of file