Closed ktlwap closed 10 months ago
@HuakunShen may I ask you to have a look into this PR?
@ktlwap How can I reproduce this problem?
I was able to reproduce it with GNOME (Ubuntu) inside a Virtual Machine. In order to be able to reproduce you do need rust, node and npm installed.
Then just clone https://github.com/nero-tools/clipboard-manager. Switch the used plugin version back to 0.3.1 in Cargo.toml
Once you've done the prior steps you could launch the application. With 0.3.1 it'll crash as soon you did the first image copy / read operation. (sometimes also reproducible while switching between virtual desktops)
(Not needed for wayland but I'd suppose that you do need that export for X11: export WEBKIT_DISABLE_COMPOSITING_MODE=1
)
In this GIF you'll see that the application crashes as soon as I take the first screenshot:
The application logic will periodically check on the content inside your clipboard and once new content is available it will crash.
For reference a build with my fixes:
As you can see, it's not crashing at all. Make sure that you delete all the compiler output before starting a new build once you switched the version.
This issue is on Windows not reproducible at all.
@ktlwap Thank you for the feedback. I tried to run your code and the original example, but failed for some reason. Probably because I had a new environment and the code was out dated.
I ended up upgrading all dependency versions, and the example app had no problem to run on ubuntu 22.04 (wayland).
I tried your repo with v0.3.2 but no window shows up.
Can you try again with the new v0.3.2?
I will merge the new version with your PR after testing. Thanks.
Merged version available at v0.4.0
Releasing the arboard instance will cause an instant crash on X11 and Wayland because it's also releasing internal ressources on display server / compositor. Keeping exactly one instance seems to fix that issue. (tested both X11 and Wayland on Gnome)
https://docs.rs/arboard/latest/arboard/struct.Clipboard.html#linux