                  logger.debug("Shutdown received")
                  break
              if not trigger:
                  continue
              # Clear trigger so calling process can set it during this run
              trigger_event.clear()
              queue_manager.flush_queue("preview_patch_in")
              self._feed_swapped_faces(patch_queue_in, samples)
              with self._lock:
                  self._update_converter_arguments()
                  self._converter.reinitialize(config=self.current_config)
 
</s> remove             if shutdown_event.is_set():
                logger.debug("Shutdown received")
                break
 </s> add  </s> remove             with self._lock:
 </s> add             with self._app.lock: </s> remove                 self._converter.reinitialize(config=self.current_config)
 </s> add                 self._converter.reinitialize(config=self._app.config_tools.config) </s> remove             with self._lock:
                self._display.destination = swapped
            tk_vars["refresh"].set(True)
            tk_vars["busy"].set(False)
 </s> add             with self._app.lock:
                self._app.display.destination = swapped

            logger.debug("Patch complete")
            trigger_event.clear() </s> remove         logger.debug("Launching patch process thread: (trigger_event: %s, shutdown_event: %s, "
                     "patch_queue_in: %s, samples: %s, tk_vars: %s)", trigger_event,
                     shutdown_event, patch_queue_in, samples, tk_vars)
 </s> add         logger.debug("Launching patch process thread: (patch_queue_in: %s, trigger_event: %s, "
                     "samples: %s)", patch_queue_in, trigger_event, samples)
            logger.debug("Patch Triggered")
                  logger.debug("Shutdown received")
                  break
              if not trigger:
                  continue
            logger.debug("Patch Triggered")
            logger.debug("Patch Triggered")
              queue_manager.flush_queue("preview_patch_in")
              self._feed_swapped_faces(patch_queue_in, samples)
              with self._lock:
                  self._update_converter_arguments()
                  self._converter.reinitialize(config=self.current_config)
keep keep keep keep replace replace keep keep keep keep keep
 bugfix:
    - preview tool - Prevent tkinter variables from exiting main thread
refactor:
    - preview tool - Split module to smaller sub-modules + docs, locales
Typing:
    - tools.preview.cli
Unit test:
    - tools.preview.viewer 
tools/preview/preview.py