x11: Implement image transfer using the MIT-SHM extension (#46)

* Implement shared memory transfer for X11

* Change to x11rb

* Fix leak + review from psychon

* Add waits to prevent illegal writes to SHM

* @ids1024 code review
This commit is contained in:
John Nunley 2023-01-06 03:27:54 +00:00 committed by GitHub
parent 0f1effe958
commit a6042f664d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 392 additions and 26 deletions

View file

@ -16,7 +16,7 @@ rust-version = "1.60.0"
default = ["x11", "wayland", "wayland-dlopen"]
wayland = ["wayland-backend", "wayland-client", "nix", "fastrand"]
wayland-dlopen = ["wayland-sys/dlopen"]
x11 = ["bytemuck", "x11rb", "x11-dl"]
x11 = ["bytemuck", "nix", "x11rb", "x11-dl"]
[dependencies]
log = "0.4.17"
@ -30,7 +30,7 @@ wayland-backend = { version = "0.1.0", features = ["client_system"], optional =
wayland-client = { version = "0.30.0", optional = true }
wayland-sys = "0.30.0"
x11-dl = { version = "2.19.1", optional = true }
x11rb = { version = "0.11.0", features = ["allow-unsafe-code", "dl-libxcb"], optional = true }
x11rb = { version = "0.11.0", features = ["allow-unsafe-code", "dl-libxcb", "shm"], optional = true }
[target.'cfg(all(unix, not(any(target_vendor = "apple", target_os = "android", target_os = "redox", target_os = "linux", target_os = "freebsd"))))'.dependencies]
fastrand = { version = "1.8.0", optional = true }