tauri-apps / plugins-workspace

All of the official Tauri plugins in one place!
https://tauri.app
Apache License 2.0
969 stars 274 forks source link

[bug][v2][clipboard-manager] Clipboard sometimes left empty after closing the Tauri app #1107

Open vemonet opened 8 months ago

vemonet commented 8 months ago

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!

FabianLars commented 3 months ago

Sorry for the long silence, which platforms did you test this on?