Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard empty when using "Take Screenshot" option #25

Open
Lucas-Steinmann opened this issue Mar 16, 2022 · 2 comments
Open

Clipboard empty when using "Take Screenshot" option #25

Lucas-Steinmann opened this issue Mar 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Lucas-Steinmann
Copy link

As the title says, the clipboard is not filled when using the "Take Screenshot" option.
The other options ("Choose File" and "Get from Clipboard") work fine.

For debugging purposes, I've compiled the app myself and added instructions to print the result when taking a screenshot.
The text was printed successfully.
That means the OCR works, but writing to the clipboard does not work.

I'm using Wayland with Gnome. I installed the app via flatpak.
I suspect a security feature of Wayland is preventing the app to write to the clipboard.
In Wayland, regular apps can only write/read to clipboard when they are focused.
Since directly after taking a screenshot, TextSnatcher is not focused, it is not able to write to the clipboard.

I've tested this hypothesis by making a large screenshot and clicking into the TextSnatcher window. This sets the focus back to TextSnatcher. While the app seems to be frozen (maybe worth another issue), it appears to get focus, since now it successfully writes to the clipboard.

But this is not a solution, since for small screenshots, the user will not be able to change the window quickly enough (and it would be user-friendly anyway).

My only idea to solve this issue is to add a button to copy to the clipboard manually.

But other features, such as printing the result into a text label UI element, could possibly also improve usability.
E.g. users could then quickly decide to retake the screenshot or copy the text, with the button.
The button could also be implemented first, to fix this issue, and the text label could be added later as a UI improvement.

I also wonder why nobody else has this issue. Am I missing something?

@RajSolai
Copy link
Owner

Thanks a lot for letting me know this issue of clipboard r/w on Wayland, the idea of having a button for manual clipboard is great. About the app freezing on OCR I will find a solution and patch it on next release.

@RajSolai RajSolai added the bug Something isn't working label Mar 17, 2022
@geometry1
Copy link

I am having the exact same issue. I am on Fedora 36 (Silverblue), so GNOME 42 and Wayland. I have TextSnatcher installed as a Flatpak. After seeing this issue I made some tests with focused/non-focused TextSnatcher window and can confirm exactly the findings of @Lucas-Steinmann .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants