mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-27 03:41:16 +01:00
This commit adds changes to the main wm process to dump a state file to temp_dir() when the process is exited either via komorebic stop or ctrl-c, and to automatically try to reload that dumped state file if it exists on the next run. A new flag "--clean-state" has been added to both komorebi.exe and the komorebic start command to override this behaviour. The dumped state file can only be applied if the number of connected monitors matches the number of monitors recorded in the state, and if every HWND listed in the state file still exists. This is validated by calling Window.exe(), which under the hood checks for the continued existence of the process associated with the HWND. Only the "workspace" subsection of the state for each matching connecting monitor will be applied.