Skip to content

fix: preserve clipboard contents and exit cleanly#18

Draft
aladin7 wants to merge 2 commits into
benmaster82:mainfrom
aladin7:agent/preserve-clipboard-clean-shutdown
Draft

fix: preserve clipboard contents and exit cleanly#18
aladin7 wants to merge 2 commits into
benmaster82:mainfrom
aladin7:agent/preserve-clipboard-clean-shutdown

Conversation

@aladin7

@aladin7 aladin7 commented Jul 16, 2026

Copy link
Copy Markdown

What changed

  • preserve safely duplicable Windows clipboard formats during dictation paste, including common image and copied-file formats
  • restore the clipboard only when WritHer’s temporary transcript is still present
  • retry clipboard transfers and avoid overwriting clipboard content copied during the paste
  • make the clipboard restoration delay configurable
  • run tray-triggered shutdown on Tk’s main thread and join tray, hotkey, and reminder threads
  • cancel service startup when shutdown is requested while the Whisper model is loading

Why

WritHer previously backed up only Unicode text, so pasting dictated text could destroy screenshots, copied files, and other non-text clipboard formats. Its tray callback could also log Shutdown complete while the Tk or tray event loop still kept Python alive.

Impact

Dictation keeps the compatible Ctrl+V workflow while preserving common clipboard content. Quitting from the tray now terminates the process deterministically, including during startup.

Validation

  • 54 tests pass on current upstream main
  • focused Ruff checks pass
  • compilation checks pass
  • git diff --check passes
  • native Windows tray + Tk lifecycle test exits cleanly
  • native CF_DIB and CF_HDROP preservation checks passed during development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant