fix: restore paste reliability on GNOME Wayland (terminals + GUI)#293
fix: restore paste reliability on GNOME Wayland (terminals + GUI)#293christian-taillon wants to merge 3 commits intoOpenWhispr:mainfrom
Conversation
|
Quick note: this still reproduces on v1.5.2 for me on Linux Wayland (GNOME) and is currently a hard failure (paste does not work). Why this needs a fix:
I still think this direction is the right fix:
|
|
Follow-up fix pushed to this PR based on GNOME Wayland testing. What changed:
Validation notes:
|
|
Merged latest Conflict resolution keeps the GNOME Wayland reliability fix:
This is the behavior validated on |
|
Hey @gabrielste1n Don't easily have other Linux environments that aren't GNOME Wayland to test this in. It shouldn't modify behavior for other scenarios, but if you can point me to anyone who can test this small change or review it, it is the last change I need to make for my self to get the intended experience. Loving the recent QoL for Linux users. I hope this idea helps and no worries if you want to take it in a different direction. |
|
@christian-taillon i'd love to see how we can make the linux-fast-paste binary the most robust solution - so instead of skipping it is there maybe something we can do to improve it? really appreciate your contributions |
That desire makes sense. Let me look at it again. See if a modification can get it to work reliably. I had used ydotool in my own dictation solution before finding OpenWhispr to handle Wayland security quirks. |
|
I spent some time trying the linux-fast-paste primary-path approach on GNOME Wayland. I added --shift-insert support in linux-fast-paste and routed the GNOME Wayland unknown-window-class case through the binary (--uinput --shift-insert) instead of skipping to external tools. In my testing (terminal, desktop editor app, browser), that path still didn’t actually paste text. What did work in the same environment was the existing ydotool Shift+Insert fallback. If others aren’t seeing this issue on their Wayland systems, that’s useful context too. Maybe it isn't Wayland security/compositor issue. Logs show successful paste but no content pasted. |
|
Linking related threads so we can track Linux auto-paste behavior in one place:
Context: PR #293 currently relies on For clarity: I'm not suggesting this should be merged as-is for maintainers. I'm applying the PR #293 patch locally on top of the latest maintainer release so I can use My current theory is this is largely Wayland security related: on Wayland, apps can't globally inject keyboard input the way X11 tools can, so approaches like Goal is still to get If anyone has findings on why |
Summary
linux-fast-pasteon GNOME Wayland (falls back to system tools which are more reliable in this environment).Shift+Insertfallback strategy when target window class cannot be detected (common on Wayland).ydotoolwhen available.Why
On GNOME Wayland (e.g. Ubuntu 24.04),
xdotooloften returnsnullfor the active window class, breaking terminal detection. This causes the app to sendCtrl+Vto terminals (printing^V) instead ofCtrl+Shift+V. Additionally, the native uinput binary reports success but often fails to deliver keystrokes to the focused window in this specific compositor environment.Fix
isGnome && !xdotoolWindowClass).Shift+Insertas a universal safe fallback chord (works in both terminals and GUI apps).Validation
Verified locally on Debian Stable (GNOME Wayland):
gnome-terminal/console(using Shift+Insert fallback).