Hi, I am using tauri v2 for a basic emoji popup desktop app: when the user click an emoji we add it to the clipboard, and we close the app (we don't want it to be running in the background)
But if I try to close the app after copying to the clipboard, the clipboard is left empty about 30 to 40% of the time (sometimes it works, sometimes no, without really a pattern, it seems to be random)
I tried many different approaches to paste the emoji to the clipboard and close the app:
Adding to clipboard and closing app window both using the JS API: clipboard empty 40% of the time
Adding to clipboard, and closing app both using the rust API: clipboard always empty
Adding to clipboard using the JS API, and closing the app in a separate thread using the rust API: seems to be the most reliable, but still fails too much, probably 30% of the time
Copying the emoji in the clipboard works 100% of the time if I just hide the window (no closing the app). So the issue seems to come from closing the app.
Hi, I am using tauri v2 for a basic emoji popup desktop app: when the user click an emoji we add it to the clipboard, and we close the app (we don't want it to be running in the background)
But if I try to close the app after copying to the clipboard, the clipboard is left empty about 30 to 40% of the time (sometimes it works, sometimes no, without really a pattern, it seems to be random)
I tried many different approaches to paste the emoji to the clipboard and close the app:
Copying the emoji in the clipboard works 100% of the time if I just hide the window (no closing the app). So the issue seems to come from closing the app.
Here is the relevant code:
Do you have any idea why the clipboard is sometimes lost when closing the app or window? And how it could be fixed?
Thanks a lot!