Empty clipboard after activating "start-listening-clipboard" DBus action
I'm using the DBus action to listen for speech and copy the text to the clipboard.
When I activate the action, it seems like it works because a notification appears:
But there is nothing in my clipboard. I also tested the "start-listening" DBus action and text appears in the app itself, but I have to manually copy the text to the clipboard. When I use the "Start listening, text to clipboard" option on the tray icon, it works correctly.
Steps to reproduce:
flatpak run net.mkiol.SpeechNote --verbose
gdbus call --session -d net.mkiol.SpeechNote -o /net/mkiol/SpeechNote -m org.freedesktop.Application.ActivateAction "start-listening-clipboard" "[]" "{}"
gdbus call --session -d net.mkiol.SpeechNote -o /net/mkiol/SpeechNote -m org.freedesktop.Application.ActivateAction "stop-listening" "[]" "{}"
Verbose logs after activating the "start-listening-clipboard" action and before activating "stop-listening": speechnote.log
I'm using Gnome Wayland on Fedora 41 if that helps.
Hi, thanks for your question.
The problem lies in Wayland. For security reason, the clipboard cannot be accessed unless the window requesting access is in focus. If the application window is hidden or in the background, reading/writing to the clipboard is blocked by Wayland. I'm not sure if this is a limitation of just Wayland or Wayland+Qt.
At the moment, practically start-listening-clipboard only makes sense under X11 :/.
I'm closing because this is a limitation (or feature) of Wayland and I can't solve it at the moment.