Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wm): restart cmd listener thread on panic
This commit ensures that in the event of a panic (we still have quite a few that occur sporadically that are still being tracked down), the listen_for_commands thread in process_command is restarted, similarly to the recently added border, stackbar and transparency manager threads. In order to do this without blocking the process startup sequence, listen_for_commands spawns an outer thread which begins a loop in which the actual command listener thread is started. We call .join() on the handle of this inner thread, and log an error whenever that inner thread terminates, as it should never terminate unless there is a panic. If the inner thread is terminated due to a panic, the outer loop will start another thread to ensure that user commands continue being processed. One thing to note is that panics may lead to an inconsistent wm state and undefined behaviour which will seem "new", as previously these panics required a total restart of komorebi and any inconsistent states would be masked.
- Loading branch information