Fix: Improve Paste Reliability with Overlay Timing Callback #394
+37
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Improve Paste Reliability with Overlay Timing Callback
This PR fixes paste failures on Linux (especially Wayland) by ensuring the overlay is fully hidden and focus is restored to the target application before attempting to paste.
Problem
On Linux/Wayland, the current implementation attempts to paste text immediately after hiding the overlay. However, Wayland window managers handle focus changes asynchronously, meaning the previous application may not have regained focus by the time the paste operation is executed. This results in:
Solution
Introduces
hide_recording_overlay_with_callback()which:This ensures reliable paste behavior across all Linux desktop environments, particularly on Wayland compositors.
Technical Changes
src-tauri/src/overlay.rs:hide_recording_overlay_with_callback<F>()function with callback supportsrc-tauri/src/actions.rs:TranscribeAction::stop()to use callback-based overlay hidingTesting
Tested on:
Related Issues