fix(linux): hide overlay before paste on GNOME Wayland#246
Open
wrt54gl wants to merge 1 commit intoOpenWhispr:mainfrom
Open
fix(linux): hide overlay before paste on GNOME Wayland#246wrt54gl wants to merge 1 commit intoOpenWhispr:mainfrom
wrt54gl wants to merge 1 commit intoOpenWhispr:mainfrom
Conversation
…us steal On GNOME Wayland with FLOATING_ICON_AUTO_HIDE enabled, BrowserWindow.show() steals focus from the target window. Since ydotool sends keystrokes to the focused window, this causes paste keystrokes to go to the OpenWhispr overlay instead of the user's application (e.g. terminal). Fix by temporarily hiding the overlay before pasting, allowing GNOME to return focus to the target window. The overlay is re-shown after paste if auto-hide is not enabled. Also restores AT-SPI2 terminal detection and GNOME-specific ydotool-first paste tool ordering that were removed in OpenWhispr#221, and adds 'open-whispr' to the AT-SPI2 skip set as a safety net. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
FLOATING_ICON_AUTO_HIDEis enabledBrowserWindow.show()steals focus from the target window on GNOME Wayland, causingydotoolkeystrokes to go to the OpenWhispr overlay instead of the user's appopen-whisprto AT-SPI2 skip set so our own window is never misidentified as the paste targetDetails
On GNOME Wayland,
BrowserWindow.show()triggers activation viaxdg_activation_v1, stealing keyboard focus. Sinceydotoolinjects key events to the focused window (via uinput), the paste keystrokes (Ctrl+V/Ctrl+Shift+V) were sent to the overlay window instead of the terminal or other target application.The fix adds a hide + 200ms delay before the paste operation in the
paste-textIPC handler, allowing the GNOME compositor to return focus to the previously active window. After paste completes, the overlay is re-shown only ifFLOATING_ICON_AUTO_HIDEis disabled.This also restores two GNOME Wayland fixes from PR #202 that were removed in #221:
xdotoolcan only see XWayland windows and returns OpenWhispr's own window. AT-SPI2 reliably detects both native Wayland and XWayland active windows.xdotoolmay silently target the wrong window while reporting success, preventing fallback toydotool.Test plan
FLOATING_ICON_AUTO_HIDEon GNOME WaylandCtrl+Shift+VCtrl+VFLOATING_ICON_AUTO_HIDE→ overlay should re-appear after paste🤖 Generated with Claude Code