golang-design / clipboard

📋 cross-platform clipboard package that supports accessing text and image in Go (macOS/Linux/Windows/Android/iOS)
https://golang.design/x/clipboard
MIT License
579 stars 64 forks source link

Crashing on wayland #61

Open ajayd-san opened 1 month ago

ajayd-san commented 1 month ago

Hey, I was trying to copy bytes to my clipboard using this library using

clipboard.Write(clipboard.FmtText, []byte(id))

But it immediately crashes, with this error:

───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: err.log
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ X Error of failed request:  BadWindow (invalid Window parameter)
   2   │   Major opcode of failed request:  18 (X_ChangeProperty)
   3   │   Resource id in failed request:  0x20000b
   4   │   Serial number of failed request:  16
   5   │   Current serial number in output stream:  18
   6   │ exit status 1

I tried it again in a Xorg session, and it works as intended.

Also I run hyprland on wayland and gnome on xorg (both of them on arch).

I can take up this issue if you point me in the right direction.