PowerToys/doc/devdocs/settingsv2/communication-with-modules.md
Alekhya 18eb6b4ffd
Dev documentation of SettingsV2 (#7335)
* created a folder for settings and added an overview, hotkey information

* basic structure for communication between settings and runner

* Added information about the IPC communication between settings and runner

* Added information about the communication between the settings process and modules

* Added details on backward compatibility

* brief overview on settings utils

* added an overview of the viewmodels and anomalies

* minor modifications

* Settings v2 dev docs (#7334)

* Added settings architecture and tech stack dev docs

* Added telemetry and updated architecture docs for settings v2

* Fix image link in ui_architecture markdown

* Added table of contents for settings v2

* Correct file path for ui architecture image

* nit fix in table of contents heading

* Add doc for xaml island tweaks

Co-authored-by: Divyansh Srivastava <somm14divi@gmail.com>
2020-10-20 14:28:06 -07:00

1.2 KiB

Communication with modules

Through runner

  • The settings process communicates changes in the UI to most modules using the runner through delegates.
  • More details on this are mentioned in runner-ipc.md.

PT Run

  • Any changes to the UI are saved by the settings process in the settings.json file located within the /Local/Microsoft/PowerToys/Launcher/ folder.
  • PT Run watches for any changes within this file and updates it's general settings or propagates the information to the plugins, depending on the type of information. Eg: The maximum number of results drop down updates the maximum number of rows in the results list which updates the general settings of PT Run whereas the drive detection checkbox details are dispatched to the indexer plugin.

Keyboard Manager

  • The Settings process and keyboard manager share access to a common default.json file which contains information about the remapped keys and shortcuts.
  • To ensure that there is no contention while both processes try to access the common file, there is a named file mutex.
  • The settings process expects the keyboard manager process to create the default.json file if it does not exist. It does not create the file in case it is not present.