clipboard icon indicating copy to clipboard operation
clipboard copied to clipboard

Crashing on wayland

Open ajayd-san opened this issue 1 year ago • 1 comments

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.

ajayd-san avatar Jul 03 '24 17:07 ajayd-san

There is no support for wayland, the linux code for accessing the clipboard uses the X11 API.

sweetbbak avatar Dec 29 '24 02:12 sweetbbak