Skip to content

Avoid activating Windows TSF during dictation start#516

Closed
aimod-cc wants to merge 1 commit into
Open-Less:betafrom
aimod-cc:fix/windows-explorer-tsf-crash
Closed

Avoid activating Windows TSF during dictation start#516
aimod-cc wants to merge 1 commit into
Open-Less:betafrom
aimod-cc:fix/windows-explorer-tsf-crash

Conversation

@aimod-cc
Copy link
Copy Markdown

@aimod-cc aimod-cc commented May 21, 2026

User description

This avoids activating the OpenLess TSF IME when a dictation session starts.

On Windows, starting dictation previously called prepare_session(), which can activate the OpenLess TSF profile and cause host processes such as Explorer to load OpenLessIme.dll. In some cases Explorer crashes with ntdll.dll / 0xc0000374 around dictation start.

The default Windows insertion path already supports paced Unicode SendInput, so this change skips TSF activation when non-TSF insertion is enabled. TSF is now prepared lazily only when non-TSF fallback is disabled and TSF insertion is explicitly required.

Verified with:

  • npm run build
  • cargo check
  • git diff --check

PR Type

Bug fix


Description

  • Skip TSF activation at dictation start

  • Use non-TSF insertion immediately

  • Lazily prepare TSF only when needed

  • Adjust Windows IME logging and helpers


Diagram Walkthrough

flowchart LR
  A["Dictation session starts"] -- "no eager TSF prep" --> B["Non-TSF insertion path"]
  B -- "Unicode SendInput" --> C["Text inserted without TSF"]
  A -- "TSF required later" --> D["Lazy TSF session preparation"]
  D -- "submit through TSF" --> E["Windows IME insertion"]
Loading

File Walkthrough

Relevant files
Bug fix
coordinator.rs
Defer Windows TSF preparation until needed                             

openless-all/app/src-tauri/src/coordinator.rs

  • Skip TSF activation when non-TSF fallback is allowed.
  • Lazily call prepare_session() only for required TSF inserts.
  • Update fallback logging to reflect actual insertion outcomes.
  • Restrict prepared-session storage helper to tests.
+14/-19 
dictation.rs
Stop preparing TSF on session begin                                           

openless-all/app/src-tauri/src/coordinator/dictation.rs

  • Remove eager Windows IME preparation from begin_session().
  • Prevent dictation start from activating the TSF profile.
  • Keep session initialization focused on state setup.
+0/-6     

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@aimod-cc aimod-cc closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant